Skip to content

Commit 071626b

Browse files
andreeaflorescujiangliu
authored andcommitted
move unsafe comment to line before unsafe
Because of the cargo fmt some lines got shifted and the comments need to be moved as well. Signed-off-by: Andreea Florescu <[email protected]>
1 parent 2deee03 commit 071626b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ioctls/vcpu.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ impl VcpuFd {
477477
}
478478

479479
let mut cpuid = CpuId::new(num_entries).map_err(|_| errno::Error::new(libc::ENOMEM))?;
480-
// SAFETY: Here we trust the kernel not to read past the end of the kvm_cpuid2 struct.
481480
let ret =
481+
// SAFETY: Here we trust the kernel not to read past the end of the kvm_cpuid2 struct.
482482
unsafe { ioctl_with_mut_ptr(self, KVM_GET_CPUID2(), cpuid.as_mut_fam_struct_ptr()) };
483483
if ret != 0 {
484484
return Err(errno::Error::last());
@@ -1092,9 +1092,9 @@ impl VcpuFd {
10921092
/// ```
10931093
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
10941094
pub fn get_reg_list(&self, reg_list: &mut RegList) -> Result<()> {
1095-
// SAFETY: This is safe because we allocated the struct and we trust the kernel will read
1096-
// exactly the size of the struct.
10971095
let ret =
1096+
// SAFETY: This is safe because we allocated the struct and we trust the kernel will read
1097+
// exactly the size of the struct.
10981098
unsafe { ioctl_with_mut_ref(self, KVM_GET_REG_LIST(), reg_list.as_mut_fam_struct()) };
10991099
if ret < 0 {
11001100
return Err(errno::Error::last());

0 commit comments

Comments
 (0)