Skip to content

Commit 833095d

Browse files
committed
treewide: other rustfmt-inspired cleanups
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent d249f15 commit 833095d

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

drivers/android/transaction.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ impl Transaction {
196196

197197
impl DeliverToRead for Transaction {
198198
fn do_work(self: Ref<Self>, thread: &Thread, writer: &mut UserSlicePtrWriter) -> Result<bool> {
199-
/* TODO: Initialise the following fields from tr:
200-
pub sender_pid: pid_t,
201-
pub sender_euid: uid_t,
202-
*/
199+
// TODO: Initialise the following fields from `tr`:
200+
// - `pub sender_pid: pid_t`.
201+
// - `pub sender_euid: uid_t`.
202+
203203
let send_failed_reply = ScopeGuard::new(|| {
204204
if self.node_ref.is_some() && self.flags & TF_ONE_WAY == 0 {
205205
let reply = Either::Right(BR_FAILED_REPLY);

rust/kernel/hwrng.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ impl<T: Operations> Registration<T> {
9696

9797
let name = CString::try_from_fmt(name)?;
9898

99-
// SAFETY: Registration is pinned and contains allocated and set to zero `bindings::hwrng` structure.
99+
// SAFETY: Registration is pinned and contains allocated and set to zero
100+
// `bindings::hwrng` structure.
100101
Self::init_hwrng(
101102
unsafe { &mut *this.hwrng.get() },
102103
&name,

rust/kernel/sync/seqlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use core::{cell::UnsafeCell, marker::PhantomPinned, ops::Deref, pin::Pin};
1717
///
1818
/// # Examples
1919
///
20-
///```
20+
/// ```
2121
/// use core::sync::atomic::{AtomicU32, Ordering};
2222
/// use kernel::sync::{SeqLock, SpinLock};
2323
///

rust/kernel/unsafe_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//!
55
//! We don't use the C version for two main reasons:
66
//! - Next/prev pointers do not support `?Sized` types, so wouldn't be able to have a list of, for
7-
//! example, dyn Trait.
7+
//! example, `dyn Trait`.
88
//! - It would require the list head to be pinned (in addition to the list entries).
99
1010
use core::{cell::UnsafeCell, iter, marker::PhantomPinned, mem::MaybeUninit, ptr::NonNull};

rust/macros/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ use proc_macro::TokenStream;
6868
/// - `description`: byte array of the description of the kernel module.
6969
/// - `license`: byte array of the license of the kernel module (required).
7070
/// - `alias`: byte array of alias name of the kernel module.
71-
/// - `alias_rtnl_link`: byte array of the `rtnl_link_alias` of the kernel module (mutually exclusive with `alias`).
71+
/// - `alias_rtnl_link`: byte array of the `rtnl_link_alias` of the kernel module
72+
/// (mutually exclusive with `alias`).
7273
/// - `params`: parameters for the kernel module, as described below.
7374
///
7475
/// # Supported parameter types
@@ -85,8 +86,8 @@ use proc_macro::TokenStream;
8586
/// - `isize`: No equivalent C param type.
8687
/// - `usize`: No equivalent C param type.
8788
/// - `str`: Corresponds to C `charp` param type. Reading returns a byte slice.
88-
/// - `ArrayParam<T,N>`: Corresponds to C parameters created using `module_param_array`. An array
89-
/// of `T`'s of length at **most** `N`.
89+
/// - `ArrayParam<T,N>`: Corresponds to C parameters created using `module_param_array`.
90+
/// An array of `T`'s of length at **most** `N`.
9091
///
9192
/// `invbool` is unsupported: it was only ever used in a few modules.
9293
/// Consider using a `bool` and inverting the logic instead.

0 commit comments

Comments
 (0)