From 802e9009b9e82b30dfecccc1eaaef2b6993bdd77 Mon Sep 17 00:00:00 2001 From: Ravi kumar Veeramally Date: Tue, 27 Jun 2023 17:26:12 +0300 Subject: [PATCH] tests: Remove "useless_conversion" clippy Between musl and glibc there is a difference in the signature of the ioctl libc function. Use an anonymous cast to force the type coversion. Signed-off-by: Ravi kumar Veeramally --- tests/integration.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index 51cd32913..a180acbf7 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -4996,7 +4996,6 @@ mod common_parallel { handle_child_output(r, &output); } - #[allow(clippy::useless_conversion)] fn create_loop_device(backing_file_path: &str, block_size: u32, num_retries: usize) -> String { const LOOP_CONFIGURE: u64 = 0x4c0a; const LOOP_CTL_GET_FREE: u64 = 0x4c82; @@ -5057,12 +5056,9 @@ mod common_parallel { .unwrap(); // Request a free loop device - let loop_device_number = unsafe { - libc::ioctl( - loop_ctl_file.as_raw_fd(), - LOOP_CTL_GET_FREE.try_into().unwrap(), - ) - }; + let loop_device_number = + unsafe { libc::ioctl(loop_ctl_file.as_raw_fd(), LOOP_CTL_GET_FREE as _) }; + if loop_device_number < 0 { panic!("Couldn't find a free loop device"); } @@ -5094,7 +5090,7 @@ mod common_parallel { let ret = unsafe { libc::ioctl( loop_device_file.as_raw_fd(), - LOOP_CONFIGURE.try_into().unwrap(), + LOOP_CONFIGURE as _, &loop_config, ) };