From: Yury Norov Date: Fri, 17 Apr 2026 03:15:27 +0000 (-0400) Subject: rust: tests: drop 'use crate' in bitmap and atomic KUnit tests X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=90b67443f04a6dde73111fbcf5ae5cb91cf3e14b;p=thirdparty%2Fkernel%2Flinux.git rust: tests: drop 'use crate' in bitmap and atomic KUnit tests The following patch makes usage of macros::kunit_tests crate conditional on the corresponding configs. When the configs are disabled, compiler warns on unused crate. So, embed it in unit test declaration. Signed-off-by: Yury Norov Reviewed-by: David Gow Acked-by: Gary Guo Link: https://patch.msgid.link/20260417031531.315281-2-ynorov@nvidia.com Signed-off-by: Miguel Ojeda --- diff --git a/rust/kernel/bitmap.rs b/rust/kernel/bitmap.rs index 83d7dea99137d..894043c9e460b 100644 --- a/rust/kernel/bitmap.rs +++ b/rust/kernel/bitmap.rs @@ -499,9 +499,7 @@ impl Bitmap { } } -use macros::kunit_tests; - -#[kunit_tests(rust_kernel_bitmap)] +#[macros::kunit_tests(rust_kernel_bitmap)] mod tests { use super::*; use kernel::alloc::flags::GFP_KERNEL; diff --git a/rust/kernel/sync/atomic/predefine.rs b/rust/kernel/sync/atomic/predefine.rs index 1d53834fcb12e..84fcd7cfcb73c 100644 --- a/rust/kernel/sync/atomic/predefine.rs +++ b/rust/kernel/sync/atomic/predefine.rs @@ -154,9 +154,7 @@ unsafe impl super::AtomicAdd for usize { } } -use crate::macros::kunit_tests; - -#[kunit_tests(rust_atomics)] +#[macros::kunit_tests(rust_atomics)] mod tests { use super::super::*;