Skip to content

Commit c4d8d19

Browse files
tool: succumb to clippy
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
1 parent 3ca6d33 commit c4d8d19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tool/microkit/src/loader.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,12 @@ impl<'a> Loader<'a> {
171171
kernel_first_paddr = Some(segment.phys_addr);
172172
}
173173

174-
if kernel_p_v_offset.is_none() {
174+
if let Some(p_v_offset) = kernel_p_v_offset {
175+
if p_v_offset != segment.virt_addr - segment.phys_addr {
176+
panic!("Kernel does not have a consistent physical to virtual offset");
177+
}
178+
} else {
175179
kernel_p_v_offset = Some(segment.virt_addr - segment.phys_addr);
176-
} else if kernel_p_v_offset.unwrap() != segment.virt_addr - segment.phys_addr {
177-
panic!("Kernel does not have a consistent physical to virtual offset");
178180
}
179181

180182
regions.push((segment.phys_addr, segment.data().as_slice()));

0 commit comments

Comments
 (0)