Skip to content

Commit 81487dc

Browse files
bjzhjingrbradford
authored andcommitted
linux-loader: Fix rustfmt errors
Reformat code as cargo fmt messages indicate. Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
1 parent eb49f57 commit 81487dc

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
// Use of this source code is governed by a BSD-style license that can be
66
// found in the LICENSE-BSD-3-Clause file.
77
//
8-
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
8+
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
99

1010
pub mod cmdline;
1111
pub mod loader;
1212

1313
extern crate vm_memory;
14-

src/loader/elf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Use of this source code is governed by a BSD-style license that can be
55
// found in the LICENSE-BSD-3-Clause file.
66
//
7-
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
7+
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
88

99
/*
1010
* automatically generated by rust-bindgen

src/loader/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl Display for Error {
112112
pub struct KernelLoaderResult {
113113
// Address in the guest memory where the kernel image starts to be loaded
114114
pub kernel_load: GuestAddress,
115-
// Offset in guest memory corresponding to the end of kernel image, in case that
115+
// Offset in guest memory corresponding to the end of kernel image, in case that
116116
// device tree blob and initrd will be loaded adjacent to kernel image.
117117
pub kernel_end: GuestUsize,
118118
// This field is only for bzImage following https://www.kernel.org/doc/Documentation/x86/boot.txt
@@ -227,7 +227,8 @@ impl KernelLoader for Elf {
227227
.read_exact_from(mem_offset, kernel_image, phdr.p_filesz as usize)
228228
.map_err(|_| Error::ReadKernelImage)?;
229229

230-
loader_result.kernel_end = mem_offset.raw_value()
230+
loader_result.kernel_end = mem_offset
231+
.raw_value()
231232
.checked_add(phdr.p_memsz as GuestUsize)
232233
.ok_or(Error::MemoryOverflow)?;
233234
}
@@ -323,7 +324,8 @@ impl KernelLoader for BzImage {
323324
.read_exact_from(mem_offset, kernel_image, kernel_size)
324325
.map_err(|_| Error::ReadBzImageCompressedKernel)?;
325326

326-
loader_result.kernel_end = mem_offset.raw_value()
327+
loader_result.kernel_end = mem_offset
328+
.raw_value()
327329
.checked_add(kernel_size as GuestUsize)
328330
.ok_or(Error::MemoryOverflow)?;
329331

src/loader/struct_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Use of this source code is governed by a BSD-style license that can be
66
// found in the LICENSE-BSD-3-Clause file.
77
//
8-
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
8+
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
99

1010
use std;
1111
use std::io::Read;

0 commit comments

Comments
 (0)