]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
rust: kernel: move `allocator` module under `alloc`
authorWedson Almeida Filho <walmeida@microsoft.com>
Thu, 28 Mar 2024 01:35:54 +0000 (22:35 -0300)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 16 Apr 2024 20:03:14 +0000 (22:03 +0200)
We will add more to the `alloc` module in subsequent patches (e.g.,
allocation flags and extension traits).

Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20240328013603.206764-2-wedsonaf@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/alloc.rs [new file with mode: 0644]
rust/kernel/alloc/allocator.rs [moved from rust/kernel/allocator.rs with 100% similarity]
rust/kernel/lib.rs

diff --git a/rust/kernel/alloc.rs b/rust/kernel/alloc.rs
new file mode 100644 (file)
index 0000000..9aa5077
--- /dev/null
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
+
+//! Extensions to the [`alloc`] crate.
+
+#[cfg(not(test))]
+#[cfg(not(testlib))]
+mod allocator;
index 08dbc3eebaefcf863f13aa03791f7a4dda22227b..1e910fe7c2c774af96171bf174ffc9ee6f945c52 100644 (file)
@@ -27,9 +27,7 @@ compile_error!("Missing kernel configuration for conditional compilation");
 // Allow proc-macros to refer to `::kernel` inside the `kernel` crate (this crate).
 extern crate self as kernel;
 
-#[cfg(not(test))]
-#[cfg(not(testlib))]
-mod allocator;
+pub mod alloc;
 mod build_assert;
 pub mod error;
 pub mod init;