From 313ca7c0f2096b8b68e514e32a5e86242202b77f Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Wed, 13 Sep 2023 12:13:38 +0200 Subject: [PATCH] gpio: silence (valid) clippy warning for now This is a valid issue, but resolving takes some time. Meanwhile, we do not want to block the CI. Issue #442 was filed to track finding a real fix. This should be reverted once the real fix happens. Signed-off-by: Erik Schilling --- crates/gpio/src/gpio.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/crates/gpio/src/gpio.rs b/crates/gpio/src/gpio.rs index e891a4e..e9e9d5e 100644 --- a/crates/gpio/src/gpio.rs +++ b/crates/gpio/src/gpio.rs @@ -219,11 +219,22 @@ impl GpioDevice for PhysDevice { .set_consumer("vhu-gpio") .map_err(Error::GpiodFailed)?; - state.request = Some(Arc::new(Mutex::new( - self.chip - .request_lines(Some(&rconfig), &lconfig) - .map_err(Error::GpiodFailed)?, - ))); + // This is causing a warning since libgpiod's request_config is + // not `Send`. + // We, however, unsafely claim that it is by marking PhysDevice as + // `Send`. This is wrong, but until we figure out what to do, we + // just silence the clippy warning here. + // + // https://github.com/rust-vmm/vhost-device/issues/442 tracks + // finding a solution to this. + #[allow(clippy::arc_with_non_send_sync)] + { + state.request = Some(Arc::new(Mutex::new( + self.chip + .request_lines(Some(&rconfig), &lconfig) + .map_err(Error::GpiodFailed)?, + ))); + } } Ok(())