Commit 4a2ae880 authored by Nell Shamrell-Harrington's avatar Nell Shamrell-Harrington Committed by Miguel Ojeda

rust: remove unneeded `kernel::prelude` imports from doctests

Rust doctests implicitly include `kernel::prelude::*`.

Removes explicit `kernel::prelude` imports from doctests.
Suggested-by: default avatarMiguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1064Signed-off-by: default avatarNell Shamrell-Harrington <nells@linux.microsoft.com>
Reviewed-by: default avatarBenno 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: default avatarMiguel Ojeda <ojeda@kernel.org>
parent ea175b2d
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
//! //!
//! ```rust //! ```rust
//! # #![allow(clippy::disallowed_names)] //! # #![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] //! #[pin_data]
//! struct DriverData { //! struct DriverData {
//! #[pin] //! #[pin]
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
//! //!
//! ```rust //! ```rust
//! # #![allow(unreachable_pub, clippy::disallowed_names)] //! # #![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}; //! use core::{ptr::addr_of_mut, marker::PhantomPinned, pin::Pin};
//! # mod bindings { //! # mod bindings {
//! # #![allow(non_camel_case_types)] //! # #![allow(non_camel_case_types)]
...@@ -413,7 +413,7 @@ macro_rules! stack_try_pin_init { ...@@ -413,7 +413,7 @@ macro_rules! stack_try_pin_init {
/// ///
/// ```rust /// ```rust
/// # #![allow(clippy::disallowed_names)] /// # #![allow(clippy::disallowed_names)]
/// # use kernel::{init, pin_init, prelude::*, init::*}; /// # use kernel::{init, pin_init, init::*};
/// # use core::pin::Pin; /// # use core::pin::Pin;
/// # #[pin_data] /// # #[pin_data]
/// # struct Foo { /// # struct Foo {
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
//! we do not need to specify ids for the fields. //! we do not need to specify ids for the fields.
//! //!
//! ``` //! ```
//! use kernel::prelude::*;
//! use kernel::sync::Arc; //! use kernel::sync::Arc;
//! use kernel::workqueue::{self, impl_has_work, new_work, Work, WorkItem}; //! use kernel::workqueue::{self, impl_has_work, new_work, Work, WorkItem};
//! //!
...@@ -75,7 +74,6 @@ ...@@ -75,7 +74,6 @@
//! The following example shows how multiple `work_struct` fields can be used: //! The following example shows how multiple `work_struct` fields can be used:
//! //!
//! ``` //! ```
//! use kernel::prelude::*;
//! use kernel::sync::Arc; //! use kernel::sync::Arc;
//! use kernel::workqueue::{self, impl_has_work, new_work, Work, WorkItem}; //! use kernel::workqueue::{self, impl_has_work, new_work, Work, WorkItem};
//! //!
...@@ -415,7 +413,6 @@ pub unsafe fn raw_get(ptr: *const Self) -> *mut bindings::work_struct { ...@@ -415,7 +413,6 @@ pub unsafe fn raw_get(ptr: *const Self) -> *mut bindings::work_struct {
/// like this: /// like this:
/// ///
/// ```no_run /// ```no_run
/// use kernel::prelude::*;
/// use kernel::workqueue::{impl_has_work, Work}; /// use kernel::workqueue::{impl_has_work, Work};
/// ///
/// struct MyWorkItem { /// struct MyWorkItem {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment