@@ -443,7 +443,7 @@ impl<H: Hal, const SIZE: usize> VirtQueue<H, SIZE> {
443443 // `indirect_list` is owned by this function and is not accessed from any other threads.
444444 unsafe {
445445 H :: unshare (
446- paddr as usize ,
446+ paddr,
447447 indirect_list. as_mut_bytes ( ) . into ( ) ,
448448 BufferDirection :: DriverToDevice ,
449449 ) ;
@@ -459,7 +459,7 @@ impl<H: Hal, const SIZE: usize> VirtQueue<H, SIZE> {
459459 unsafe {
460460 // Unshare the buffer (and perhaps copy its contents back to the original
461461 // buffer).
462- H :: unshare ( indirect_list[ i] . addr as usize , buffer, direction) ;
462+ H :: unshare ( indirect_list[ i] . addr , buffer, direction) ;
463463 }
464464 }
465465 drop ( indirect_list) ;
@@ -487,7 +487,7 @@ impl<H: Hal, const SIZE: usize> VirtQueue<H, SIZE> {
487487 // from which we got `paddr`.
488488 unsafe {
489489 // Unshare the buffer (and perhaps copy its contents back to the original buffer).
490- H :: unshare ( paddr as usize , buffer, direction) ;
490+ H :: unshare ( paddr, buffer, direction) ;
491491 }
492492 }
493493
@@ -640,12 +640,12 @@ impl<H: Hal> VirtQueueLayout<H> {
640640 match self {
641641 Self :: Legacy {
642642 dma, avail_offset, ..
643- } => dma. paddr ( ) + avail_offset,
643+ } => dma. paddr ( ) + * avail_offset as u64 ,
644644 Self :: Modern {
645645 driver_to_device_dma,
646646 avail_offset,
647647 ..
648- } => driver_to_device_dma. paddr ( ) + avail_offset,
648+ } => driver_to_device_dma. paddr ( ) + * avail_offset as u64 ,
649649 }
650650 }
651651
@@ -668,7 +668,7 @@ impl<H: Hal> VirtQueueLayout<H> {
668668 match self {
669669 Self :: Legacy {
670670 used_offset, dma, ..
671- } => dma. paddr ( ) + used_offset,
671+ } => dma. paddr ( ) + * used_offset as u64 ,
672672 Self :: Modern {
673673 device_to_driver_dma,
674674 ..
@@ -699,7 +699,7 @@ fn queue_part_sizes(queue_size: u16) -> (usize, usize, usize) {
699699 queue_size. is_power_of_two( ) ,
700700 "queue size should be a power of 2"
701701 ) ;
702- let queue_size = queue_size as usize ;
702+ let queue_size = usize:: from ( queue_size ) ;
703703 let desc = size_of :: < Descriptor > ( ) * queue_size;
704704 let avail = size_of :: < u16 > ( ) * ( 3 + queue_size) ;
705705 let used = size_of :: < u16 > ( ) * 3 + size_of :: < UsedElem > ( ) * queue_size;
@@ -729,7 +729,7 @@ impl Descriptor {
729729 ) {
730730 // SAFETY: Our caller promises that the buffer is valid.
731731 unsafe {
732- self . addr = H :: share ( buf, direction) as u64 ;
732+ self . addr = H :: share ( buf, direction) ;
733733 }
734734 self . len = buf. len ( ) . try_into ( ) . unwrap ( ) ;
735735 self . flags = extra_flags
0 commit comments