From b74d8df552744ba9552c56084bb2948538010ee8 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 23 Aug 2022 16:35:46 -0700 Subject: [PATCH] io_uring: use unsigned_abs() for isize -> usize Fixes a new clippy lint: We still need the cast to u32, since the other parts of the expression are u32. BUG=b:243677117 TEST=tools/clippy # with Rust 1.62 Change-Id: Ifb6176f310f3cc7377410c251142a0f062a1ddd4 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3854969 Tested-by: Daniel Verkamp Commit-Queue: Daniel Verkamp Reviewed-by: Dennis Kempin --- io_uring/src/uring.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/src/uring.rs b/io_uring/src/uring.rs index 4833111881..175157be1e 100644 --- a/io_uring/src/uring.rs +++ b/io_uring/src/uring.rs @@ -1598,7 +1598,7 @@ mod tests { // wake up the completer threads may still be in the completion ring. assert!(uring.complete_ring.num_ready() <= NUM_COMPLETERS as u32); assert_eq!( - in_flight.lock().abs() as u32 + uring.complete_ring.num_ready(), + in_flight.lock().unsigned_abs() as u32 + uring.complete_ring.num_ready(), NUM_COMPLETERS as u32 ); assert_eq!(uring.submit_ring.lock().added, 0);