@@ -409,14 +409,14 @@ where
409
409
let end_inclusive_copy_address = cmp:: min ( end_inclusive_addr, page_end_inclusive) ;
410
410
411
411
// These are the offsets into the frame we want to copy from.
412
- let start_offset_in_frame = ( start_copy_address - page_start) as usize ;
413
- let end_inclusive_offset_in_frame = ( end_inclusive_copy_address - page_start) as usize ;
412
+ let start_offset_in_frame = start_copy_address - page_start;
413
+ let end_inclusive_offset_in_frame = end_inclusive_copy_address - page_start;
414
414
415
415
// Calculate how many bytes we want to copy from this frame.
416
416
let copy_len = end_inclusive_offset_in_frame - start_offset_in_frame + 1 ;
417
417
418
418
// Calculate the physical addresses.
419
- let start_phys_addr = phys_addr. start_address ( ) + start_offset_in_frame as u64 ;
419
+ let start_phys_addr = phys_addr. start_address ( ) + start_offset_in_frame;
420
420
421
421
// These are the offsets from the start address. These correspond
422
422
// to the destination indices in `buf`.
@@ -429,11 +429,11 @@ where
429
429
// SAFETY: We know that this memory is valid because we got it
430
430
// as a result from a translation. There are not other
431
431
// references to it.
432
- & mut * core:: ptr:: slice_from_raw_parts_mut ( dest_ptr, copy_len)
432
+ & mut * core:: ptr:: slice_from_raw_parts_mut ( dest_ptr, copy_len as usize )
433
433
} ;
434
434
435
435
// Calculate the destination pointer.
436
- let src = & buf[ start_offset_in_buf..] [ ..copy_len] ;
436
+ let src = & buf[ start_offset_in_buf..] [ ..copy_len as usize ] ;
437
437
438
438
// Do the actual copy.
439
439
dest. copy_from_slice ( src) ;
0 commit comments