Skip to content

Commit e83bbef

Browse files
Valentin Obstojeda
authored andcommitted
rust: kernel: mark code fragments in docs with backticks
Fix places where comments include code fragments that are not enclosed in backticks. Signed-off-by: Valentin Obst <kernel@valentinobst.de> Reviewed-by: Trevor Gross <tmgross@umich.edu> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240131-doc-fixes-v3-v3-8-0c8af94ed7de@valentinobst.de Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 9d29c25 commit e83bbef

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

rust/kernel/ioctl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22

3-
//! ioctl() number definitions.
3+
//! `ioctl()` number definitions.
44
//!
55
//! C header: [`include/asm-generic/ioctl.h`](srctree/include/asm-generic/ioctl.h)
66

rust/kernel/sync/lock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub unsafe trait Backend {
2828
/// The state required by the lock.
2929
type State;
3030

31-
/// The state required to be kept between lock and unlock.
31+
/// The state required to be kept between `lock` and `unlock`.
3232
type GuardState;
3333

3434
/// Initialises the lock.

rust/kernel/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl Task {
132132
/// Returns the group leader of the given task.
133133
pub fn group_leader(&self) -> &Task {
134134
// SAFETY: By the type invariant, we know that `self.0` is a valid task. Valid tasks always
135-
// have a valid group_leader.
135+
// have a valid `group_leader`.
136136
let ptr = unsafe { *ptr::addr_of!((*self.0.get()).group_leader) };
137137

138138
// SAFETY: The lifetime of the returned task reference is tied to the lifetime of `self`,

rust/kernel/workqueue.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl Queue {
168168
/// # Safety
169169
///
170170
/// The caller must ensure that the provided raw pointer is not dangling, that it points at a
171-
/// valid workqueue, and that it remains valid until the end of 'a.
171+
/// valid workqueue, and that it remains valid until the end of `'a`.
172172
pub unsafe fn from_raw<'a>(ptr: *const bindings::workqueue_struct) -> &'a Queue {
173173
// SAFETY: The `Queue` type is `#[repr(transparent)]`, so the pointer cast is valid. The
174174
// caller promises that the pointer is not dangling.
@@ -414,8 +414,8 @@ impl<T: ?Sized, const ID: u64> Work<T, ID> {
414414
///
415415
/// # Safety
416416
///
417-
/// The [`OFFSET`] constant must be the offset of a field in Self of type [`Work<T, ID>`]. The methods on
418-
/// this trait must have exactly the behavior that the definitions given below have.
417+
/// The [`OFFSET`] constant must be the offset of a field in `Self` of type [`Work<T, ID>`]. The
418+
/// methods on this trait must have exactly the behavior that the definitions given below have.
419419
///
420420
/// [`Work<T, ID>`]: Work
421421
/// [`impl_has_work!`]: crate::impl_has_work
@@ -428,7 +428,8 @@ pub unsafe trait HasWork<T, const ID: u64 = 0> {
428428

429429
/// Returns the offset of the [`Work<T, ID>`] field.
430430
///
431-
/// This method exists because the [`OFFSET`] constant cannot be accessed if the type is not Sized.
431+
/// This method exists because the [`OFFSET`] constant cannot be accessed if the type is not
432+
/// `Sized`.
432433
///
433434
/// [`Work<T, ID>`]: Work
434435
/// [`OFFSET`]: HasWork::OFFSET

0 commit comments

Comments
 (0)