@@ -342,14 +342,14 @@ where
342
342
let end_inclusive_copy_address = cmp:: min ( end_inclusive_addr, page_end_inclusive) ;
343
343
344
344
// These are the offsets into the frame we want to copy from.
345
- let start_offset_in_frame = ( start_copy_address - page_start) as usize ;
346
- let end_inclusive_offset_in_frame = ( end_inclusive_copy_address - page_start) as usize ;
345
+ let start_offset_in_frame = start_copy_address - page_start;
346
+ let end_inclusive_offset_in_frame = end_inclusive_copy_address - page_start;
347
347
348
348
// Calculate how many bytes we want to copy from this frame.
349
349
let copy_len = end_inclusive_offset_in_frame - start_offset_in_frame + 1 ;
350
350
351
351
// Calculate the physical addresses.
352
- let start_phys_addr = phys_addr. start_address ( ) + start_offset_in_frame as u64 ;
352
+ let start_phys_addr = phys_addr. start_address ( ) + start_offset_in_frame;
353
353
354
354
// These are the offsets from the start address. These correspond
355
355
// to the destination indices in `buf`.
@@ -362,11 +362,11 @@ where
362
362
// SAFETY: We know that this memory is valid because we got it
363
363
// as a result from a translation. There are not other
364
364
// references to it.
365
- & * core:: ptr:: slice_from_raw_parts ( src_ptr, copy_len)
365
+ & * core:: ptr:: slice_from_raw_parts ( src_ptr, copy_len as usize )
366
366
} ;
367
367
368
368
// Calculate the destination pointer.
369
- let dest = & mut buf[ start_offset_in_buf..] [ ..copy_len] ;
369
+ let dest = & mut buf[ start_offset_in_buf..] [ ..copy_len as usize ] ;
370
370
371
371
// Do the actual copy.
372
372
dest. copy_from_slice ( src) ;
0 commit comments