@@ -95,13 +95,6 @@ impl MmioTransport {
9595 self . device_status & ( set | clr) == set
9696 }
9797
98- fn are_queues_valid ( & self ) -> bool {
99- self . locked_device ( )
100- . queues ( )
101- . iter ( )
102- . all ( |q| q. is_valid ( & self . mem ) )
103- }
104-
10598 fn with_queue < U , F > ( & self , d : U , f : F ) -> U
10699 where
107100 F : FnOnce ( & Queue ) -> U ,
@@ -185,7 +178,7 @@ impl MmioTransport {
185178 DRIVER_OK if self . device_status == ( ACKNOWLEDGE | DRIVER | FEATURES_OK ) => {
186179 self . device_status = status;
187180 let device_activated = self . locked_device ( ) . is_activated ( ) ;
188- if !device_activated && self . are_queues_valid ( ) {
181+ if !device_activated {
189182 // temporary variable needed for borrow checker
190183 let activate_result = self . locked_device ( ) . activate ( self . mem . clone ( ) ) ;
191184 if let Err ( err) = activate_result {
@@ -486,8 +479,6 @@ pub(crate) mod tests {
486479
487480 assert_eq ! ( d. locked_device( ) . queue_events( ) . len( ) , 2 ) ;
488481
489- assert ! ( !d. are_queues_valid( ) ) ;
490-
491482 d. queue_select = 0 ;
492483 assert_eq ! ( d. with_queue( 0 , |q| q. max_size) , 16 ) ;
493484 assert ! ( d. with_queue_mut( |q| q. size = 16 ) ) ;
@@ -501,8 +492,6 @@ pub(crate) mod tests {
501492 d. queue_select = 2 ;
502493 assert_eq ! ( d. with_queue( 0 , |q| q. max_size) , 0 ) ;
503494 assert ! ( !d. with_queue_mut( |q| q. size = 16 ) ) ;
504-
505- assert ! ( !d. are_queues_valid( ) ) ;
506495 }
507496
508497 #[ test]
@@ -761,7 +750,6 @@ pub(crate) mod tests {
761750 let m = single_region_mem ( 0x1000 ) ;
762751 let mut d = MmioTransport :: new ( m, Arc :: new ( Mutex :: new ( DummyDevice :: new ( ) ) ) , false ) ;
763752
764- assert ! ( !d. are_queues_valid( ) ) ;
765753 assert ! ( !d. locked_device( ) . is_activated( ) ) ;
766754 assert_eq ! ( d. device_status, device_status:: INIT ) ;
767755
@@ -800,7 +788,6 @@ pub(crate) mod tests {
800788 write_le_u32 ( & mut buf[ ..] , 1 ) ;
801789 d. bus_write ( 0x44 , & buf[ ..] ) ;
802790 }
803- assert ! ( d. are_queues_valid( ) ) ;
804791 assert ! ( !d. locked_device( ) . is_activated( ) ) ;
805792
806793 // Device should be ready for activation now.
@@ -860,7 +847,6 @@ pub(crate) mod tests {
860847 write_le_u32 ( & mut buf[ ..] , 1 ) ;
861848 d. bus_write ( 0x44 , & buf[ ..] ) ;
862849 }
863- assert ! ( d. are_queues_valid( ) ) ;
864850 assert_eq ! (
865851 d. locked_device( ) . interrupt_status( ) . load( Ordering :: SeqCst ) ,
866852 0
@@ -910,7 +896,6 @@ pub(crate) mod tests {
910896 write_le_u32 ( & mut buf[ ..] , 1 ) ;
911897 d. bus_write ( 0x44 , & buf[ ..] ) ;
912898 }
913- assert ! ( d. are_queues_valid( ) ) ;
914899 assert ! ( !d. locked_device( ) . is_activated( ) ) ;
915900
916901 // Device should be ready for activation now.
@@ -937,7 +922,6 @@ pub(crate) mod tests {
937922 let mut d = MmioTransport :: new ( m, Arc :: new ( Mutex :: new ( DummyDevice :: new ( ) ) ) , false ) ;
938923 let mut buf = [ 0 ; 4 ] ;
939924
940- assert ! ( !d. are_queues_valid( ) ) ;
941925 assert ! ( !d. locked_device( ) . is_activated( ) ) ;
942926 assert_eq ! ( d. device_status, 0 ) ;
943927 activate_device ( & mut d) ;
0 commit comments