rust: io: cleanup imports and use "kernel vertical" style
Commit 46f045db5a ("rust: Add read_poll_timeout_atomic function")
initiated the first import change in the I/O module using the agreed
"kernel vertical" import style [1].
For consistency throughout the module, adjust all other imports
accordingly.
While at it, drop unnecessary imports covered by prelude::*.
Link: https://docs.kernel.org/rust/coding-guidelines.html#imports [1]
Reviewed-by: Zhi Wang <zhiw@nvidia.com>
Link: https://patch.msgid.link/20251104133301.59402-1-dakr@kernel.org
[ Use prelude::* in io/poll.rs. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
@@ -4,8 +4,10 @@
|
|||||||
//!
|
//!
|
||||||
//! C header: [`include/asm-generic/io.h`](srctree/include/asm-generic/io.h)
|
//! C header: [`include/asm-generic/io.h`](srctree/include/asm-generic/io.h)
|
||||||
|
|
||||||
use crate::error::{code::EINVAL, Result};
|
use crate::{
|
||||||
use crate::{bindings, build_assert, ffi::c_void};
|
bindings,
|
||||||
|
prelude::*, //
|
||||||
|
};
|
||||||
|
|
||||||
pub mod mem;
|
pub mod mem;
|
||||||
pub mod poll;
|
pub mod poll;
|
||||||
|
|||||||
@@ -4,16 +4,24 @@
|
|||||||
|
|
||||||
use core::ops::Deref;
|
use core::ops::Deref;
|
||||||
|
|
||||||
use crate::c_str;
|
use crate::{
|
||||||
use crate::device::Bound;
|
c_str,
|
||||||
use crate::device::Device;
|
device::{
|
||||||
use crate::devres::Devres;
|
Bound,
|
||||||
use crate::io;
|
Device, //
|
||||||
use crate::io::resource::Region;
|
},
|
||||||
use crate::io::resource::Resource;
|
devres::Devres,
|
||||||
use crate::io::Io;
|
io::{
|
||||||
use crate::io::IoRaw;
|
self,
|
||||||
use crate::prelude::*;
|
resource::{
|
||||||
|
Region,
|
||||||
|
Resource, //
|
||||||
|
},
|
||||||
|
Io,
|
||||||
|
IoRaw, //
|
||||||
|
},
|
||||||
|
prelude::*,
|
||||||
|
};
|
||||||
|
|
||||||
/// An IO request for a specific device and resource.
|
/// An IO request for a specific device and resource.
|
||||||
pub struct IoRequest<'a> {
|
pub struct IoRequest<'a> {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//! C header: [`include/linux/iopoll.h`](srctree/include/linux/iopoll.h).
|
//! C header: [`include/linux/iopoll.h`](srctree/include/linux/iopoll.h).
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
error::{code::*, Result},
|
prelude::*,
|
||||||
processor::cpu_relax,
|
processor::cpu_relax,
|
||||||
task::might_sleep,
|
task::might_sleep,
|
||||||
time::{
|
time::{
|
||||||
|
|||||||
@@ -5,12 +5,16 @@
|
|||||||
//!
|
//!
|
||||||
//! C header: [`include/linux/ioport.h`](srctree/include/linux/ioport.h)
|
//! C header: [`include/linux/ioport.h`](srctree/include/linux/ioport.h)
|
||||||
|
|
||||||
use core::ops::Deref;
|
use core::{
|
||||||
use core::ptr::NonNull;
|
ops::Deref,
|
||||||
|
ptr::NonNull, //
|
||||||
|
};
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::{
|
||||||
use crate::str::{CStr, CString};
|
prelude::*,
|
||||||
use crate::types::Opaque;
|
str::CString,
|
||||||
|
types::Opaque, //
|
||||||
|
};
|
||||||
|
|
||||||
/// Resource Size type.
|
/// Resource Size type.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user