summaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorYury Norov <ynorov@nvidia.com>2026-04-16 23:15:27 -0400
committerMiguel Ojeda <ojeda@kernel.org>2026-06-08 02:30:33 +0200
commit90b67443f04a6dde73111fbcf5ae5cb91cf3e14b (patch)
tree5656d7942f4016623f03819047f00c04bde406c6 /rust/kernel
parent838a0871cb3cf5988560d17afaaf57592bdb486b (diff)
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 <ynorov@nvidia.com> Reviewed-by: David Gow <david@davidgow.net> Acked-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260417031531.315281-2-ynorov@nvidia.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel')
-rw-r--r--rust/kernel/bitmap.rs4
-rw-r--r--rust/kernel/sync/atomic/predefine.rs4
2 files changed, 2 insertions, 6 deletions
diff --git a/rust/kernel/bitmap.rs b/rust/kernel/bitmap.rs
index 83d7dea99137..894043c9e460 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 1d53834fcb12..84fcd7cfcb73 100644
--- a/rust/kernel/sync/atomic/predefine.rs
+++ b/rust/kernel/sync/atomic/predefine.rs
@@ -154,9 +154,7 @@ unsafe impl super::AtomicAdd<usize> for usize {
}
}
-use crate::macros::kunit_tests;
-
-#[kunit_tests(rust_atomics)]
+#[macros::kunit_tests(rust_atomics)]
mod tests {
use super::super::*;