summaryrefslogtreecommitdiffstats
path: root/rust
diff options
context:
space:
mode:
authorNell Shamrell-Harrington <nells@linux.microsoft.com>2024-04-11 22:53:31 +0000
committerMiguel Ojeda <ojeda@kernel.org>2024-05-05 18:09:04 +0200
commit4a2ae8805129d45287ef82172fd38f7ed0ddc31f (patch)
treeebd8d711b03ba82e356674e5cb4333dce075e477 /rust
parentea175b2d6f09efb77bdeb690dea9cac232a412e1 (diff)
downloadlinux-4a2ae8805129d45287ef82172fd38f7ed0ddc31f.tar.gz
linux-4a2ae8805129d45287ef82172fd38f7ed0ddc31f.tar.bz2
linux-4a2ae8805129d45287ef82172fd38f7ed0ddc31f.zip
rust: remove unneeded `kernel::prelude` imports from doctests
Rust doctests implicitly include `kernel::prelude::*`. Removes explicit `kernel::prelude` imports from doctests. Suggested-by: Miguel Ojeda <ojeda@kernel.org> Link: https://github.com/Rust-for-Linux/linux/issues/1064 Signed-off-by: Nell Shamrell-Harrington <nells@linux.microsoft.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20240411225331.274662-1-nells@linux.microsoft.com [ Add it back for `module_phy_driver`'s example since it is within a `mod`, and thus it cannot be removed. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust')
-rw-r--r--rust/kernel/init.rs6
-rw-r--r--rust/kernel/workqueue.rs3
2 files changed, 3 insertions, 6 deletions
diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs
index 9608f2bd2211..75322c2e6e7c 100644
--- a/rust/kernel/init.rs
+++ b/rust/kernel/init.rs
@@ -88,7 +88,7 @@
//!
//! ```rust
//! # #![allow(clippy::disallowed_names)]
-//! # use kernel::{sync::Mutex, prelude::*, new_mutex, init::PinInit, try_pin_init};
+//! # use kernel::{sync::Mutex, new_mutex, init::PinInit, try_pin_init};
//! #[pin_data]
//! struct DriverData {
//! #[pin]
@@ -122,7 +122,7 @@
//!
//! ```rust
//! # #![allow(unreachable_pub, clippy::disallowed_names)]
-//! use kernel::{prelude::*, init, types::Opaque};
+//! use kernel::{init, types::Opaque};
//! use core::{ptr::addr_of_mut, marker::PhantomPinned, pin::Pin};
//! # mod bindings {
//! # #![allow(non_camel_case_types)]
@@ -413,7 +413,7 @@ macro_rules! stack_try_pin_init {
///
/// ```rust
/// # #![allow(clippy::disallowed_names)]
-/// # use kernel::{init, pin_init, prelude::*, init::*};
+/// # use kernel::{init, pin_init, init::*};
/// # use core::pin::Pin;
/// # #[pin_data]
/// # struct Foo {
diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs
index 9f47bad0b003..22813b76861d 100644
--- a/rust/kernel/workqueue.rs
+++ b/rust/kernel/workqueue.rs
@@ -33,7 +33,6 @@
//! we do not need to specify ids for the fields.
//!
//! ```
-//! use kernel::prelude::*;
//! use kernel::sync::Arc;
//! use kernel::workqueue::{self, impl_has_work, new_work, Work, WorkItem};
//!
@@ -75,7 +74,6 @@
//! The following example shows how multiple `work_struct` fields can be used:
//!
//! ```
-//! use kernel::prelude::*;
//! use kernel::sync::Arc;
//! use kernel::workqueue::{self, impl_has_work, new_work, Work, WorkItem};
//!
@@ -415,7 +413,6 @@ impl<T: ?Sized, const ID: u64> Work<T, ID> {
/// like this:
///
/// ```no_run
-/// use kernel::prelude::*;
/// use kernel::workqueue::{impl_has_work, Work};
///
/// struct MyWorkItem {