@@ -339,9 +339,7 @@ impl Balloon {
339
339
340
340
// Acknowledge the receipt of the descriptor.
341
341
// 0 is number of bytes the device has written to memory.
342
- queue
343
- . add_used ( mem, head. index , 0 )
344
- . map_err ( BalloonError :: Queue ) ?;
342
+ queue. add_used ( head. index , 0 ) . map_err ( BalloonError :: Queue ) ?;
345
343
needs_interrupt = true ;
346
344
}
347
345
@@ -380,9 +378,7 @@ impl Balloon {
380
378
let mut needs_interrupt = false ;
381
379
382
380
while let Some ( head) = queue. pop ( mem) {
383
- queue
384
- . add_used ( mem, head. index , 0 )
385
- . map_err ( BalloonError :: Queue ) ?;
381
+ queue. add_used ( head. index , 0 ) . map_err ( BalloonError :: Queue ) ?;
386
382
needs_interrupt = true ;
387
383
}
388
384
@@ -404,7 +400,7 @@ impl Balloon {
404
400
// the protocol, but return it if we find one.
405
401
error ! ( "balloon: driver is not compliant, more than one stats buffer received" ) ;
406
402
self . queues [ STATS_INDEX ]
407
- . add_used ( mem , prev_stats_desc, 0 )
403
+ . add_used ( prev_stats_desc, 0 )
408
404
. map_err ( BalloonError :: Queue ) ?;
409
405
}
410
406
for index in ( 0 ..head. len ) . step_by ( SIZE_OF_STAT ) {
@@ -450,14 +446,11 @@ impl Balloon {
450
446
}
451
447
452
448
fn trigger_stats_update ( & mut self ) -> Result < ( ) , BalloonError > {
453
- // This is safe since we checked in the event handler that the device is activated.
454
- let mem = self . device_state . mem ( ) . unwrap ( ) ;
455
-
456
449
// The communication is driven by the device by using the buffer
457
450
// and sending a used buffer notification
458
451
if let Some ( index) = self . stats_desc_index . take ( ) {
459
452
self . queues [ STATS_INDEX ]
460
- . add_used ( mem , index, 0 )
453
+ . add_used ( index, 0 )
461
454
. map_err ( BalloonError :: Queue ) ?;
462
455
self . signal_used_queue ( )
463
456
} else {
0 commit comments