@@ -224,7 +224,7 @@ impl KernelLoader for Elf {
224
224
// Sanity checks.
225
225
Self :: validate_header ( & ehdr) ?;
226
226
if let Some ( addr) = highmem_start_address {
227
- if ( ehdr. e_entry as u64 ) < addr. raw_value ( ) {
227
+ if ( ehdr. e_entry ) < addr. raw_value ( ) {
228
228
return Err ( Error :: InvalidEntryAddress . into ( ) ) ;
229
229
}
230
230
}
@@ -234,10 +234,10 @@ impl KernelLoader for Elf {
234
234
Some ( k_offset) => GuestAddress (
235
235
k_offset
236
236
. raw_value ( )
237
- . checked_add ( ehdr. e_entry as u64 )
237
+ . checked_add ( ehdr. e_entry )
238
238
. ok_or ( Error :: Overflow ) ?,
239
239
) ,
240
- None => GuestAddress ( ehdr. e_entry as u64 ) ,
240
+ None => GuestAddress ( ehdr. e_entry ) ,
241
241
} ,
242
242
..Default :: default ( )
243
243
} ;
@@ -282,9 +282,9 @@ impl KernelLoader for Elf {
282
282
// load it to the physical address p_paddr for each segment.
283
283
let mem_offset = match kernel_offset {
284
284
Some ( k_offset) => k_offset
285
- . checked_add ( phdr. p_paddr as u64 )
285
+ . checked_add ( phdr. p_paddr )
286
286
. ok_or ( Error :: InvalidProgramHeaderAddress ) ?,
287
- None => GuestAddress ( phdr. p_paddr as u64 ) ,
287
+ None => GuestAddress ( phdr. p_paddr ) ,
288
288
} ;
289
289
290
290
guest_mem
0 commit comments