diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs index 9af0eea958084f..d4d7503ce09cb9 100644 --- a/rust/kernel/prelude.rs +++ b/rust/kernel/prelude.rs @@ -26,3 +26,5 @@ pub use super::module_misc_device; pub use super::static_assert; pub use super::{Error, KernelModule, Result}; + +pub use super::{str::CStr, ThisModule}; diff --git a/samples/rust/rust_chrdev.rs b/samples/rust/rust_chrdev.rs index f7888bc2817072..5a37c59019d7b2 100644 --- a/samples/rust/rust_chrdev.rs +++ b/samples/rust/rust_chrdev.rs @@ -6,7 +6,7 @@ #![feature(allocator_api, global_asm)] use kernel::prelude::*; -use kernel::{chrdev, file_operations::FileOperations, str::CStr, ThisModule}; +use kernel::{chrdev, file_operations::FileOperations}; module! { type: RustChrdev, diff --git a/samples/rust/rust_minimal.rs b/samples/rust/rust_minimal.rs index 14661422320836..3276dbe8ae94b2 100644 --- a/samples/rust/rust_minimal.rs +++ b/samples/rust/rust_minimal.rs @@ -5,7 +5,7 @@ #![no_std] #![feature(allocator_api, global_asm)] -use kernel::{prelude::*, str::CStr, ThisModule}; +use kernel::prelude::*; module! { type: RustMinimal, diff --git a/samples/rust/rust_miscdev.rs b/samples/rust/rust_miscdev.rs index 54aaa2348a5566..d034cfae81b712 100644 --- a/samples/rust/rust_miscdev.rs +++ b/samples/rust/rust_miscdev.rs @@ -11,9 +11,7 @@ use kernel::{ file_operations::{FileOpener, FileOperations}, io_buffer::{IoBufferReader, IoBufferWriter}, miscdev, - str::CStr, sync::{CondVar, Mutex, Ref}, - ThisModule, }; module! { diff --git a/samples/rust/rust_module_parameters.rs b/samples/rust/rust_module_parameters.rs index 987f89623cd83f..5e4c39648010b5 100644 --- a/samples/rust/rust_module_parameters.rs +++ b/samples/rust/rust_module_parameters.rs @@ -5,7 +5,7 @@ #![no_std] #![feature(allocator_api, global_asm)] -use kernel::{prelude::*, str::CStr, ThisModule}; +use kernel::prelude::*; module! { type: RustModuleParameters, diff --git a/samples/rust/rust_semaphore.rs b/samples/rust/rust_semaphore.rs index f437483a1413ee..a32f2666bdcded 100644 --- a/samples/rust/rust_semaphore.rs +++ b/samples/rust/rust_semaphore.rs @@ -25,10 +25,8 @@ use kernel::{ miscdev::Registration, mutex_init, prelude::*, - str::CStr, sync::{CondVar, Mutex, Ref}, user_ptr::{UserSlicePtrReader, UserSlicePtrWriter}, - ThisModule, }; module! { diff --git a/samples/rust/rust_stack_probing.rs b/samples/rust/rust_stack_probing.rs index 77fba9b6315406..4f44fade96aadc 100644 --- a/samples/rust/rust_stack_probing.rs +++ b/samples/rust/rust_stack_probing.rs @@ -6,7 +6,7 @@ #![feature(allocator_api, global_asm)] #![feature(bench_black_box)] -use kernel::{prelude::*, str::CStr, ThisModule}; +use kernel::prelude::*; module! { type: RustStackProbing, diff --git a/samples/rust/rust_sync.rs b/samples/rust/rust_sync.rs index 07e8fe7d788f40..f71f8928d16e58 100644 --- a/samples/rust/rust_sync.rs +++ b/samples/rust/rust_sync.rs @@ -8,9 +8,7 @@ use kernel::prelude::*; use kernel::{ condvar_init, mutex_init, spinlock_init, - str::CStr, sync::{CondVar, Mutex, SpinLock}, - ThisModule, }; module! {