From: Valentin Obst <kernel@valentinobst.de>
To: Miguel Ojeda <ojeda@kernel.org>,
Alex Gaynor <alex.gaynor@gmail.com>,
Wedson Almeida Filho <wedsonaf@gmail.com>
Cc: "Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@samsung.com>,
"Alice Ryhl" <aliceryhl@google.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
"Valentin Obst" <kernel@valentinobst.de>
Subject: [PATCH 08/13] rust: kernel: mark code fragments in docs with backticks
Date: Wed, 17 Jan 2024 00:09:51 +0100 [thread overview]
Message-ID: <20240116230951.168808-1-kernel@valentinobst.de> (raw)
In-Reply-To: <20240116160141.165951-1-kernel@valentinobst.de>
Fix places where comments include code fragments that are not enclosed
in backticks.
Signed-off-by: Valentin Obst <kernel@valentinobst.de>
---
rust/kernel/ioctl.rs | 2 +-
rust/kernel/sync/lock.rs | 2 +-
rust/kernel/task.rs | 2 +-
rust/kernel/workqueue.rs | 9 +++++----
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/rust/kernel/ioctl.rs b/rust/kernel/ioctl.rs
index 5987ad6d38a7..cfa7d080b531 100644
--- a/rust/kernel/ioctl.rs
+++ b/rust/kernel/ioctl.rs
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
-//! ioctl() number definitions.
+//! `ioctl()` number definitions.
//!
//! C header: [`include/asm-generic/ioctl.h`](srctree/include/asm-generic/ioctl.h)
diff --git a/rust/kernel/sync/lock.rs b/rust/kernel/sync/lock.rs
index f12a684bc957..467249b39f71 100644
--- a/rust/kernel/sync/lock.rs
+++ b/rust/kernel/sync/lock.rs
@@ -28,7 +28,7 @@ pub unsafe trait Backend {
/// The state required by the lock.
type State;
- /// The state required to be kept between lock and unlock.
+ /// The state required to be kept between `lock` and `unlock`.
type GuardState;
/// Initialises the lock.
diff --git a/rust/kernel/task.rs b/rust/kernel/task.rs
index 818ac51b06b6..d4b0d232480d 100644
--- a/rust/kernel/task.rs
+++ b/rust/kernel/task.rs
@@ -116,7 +116,7 @@ fn deref(&self) -> &Self::Target {
/// Returns the group leader of the given task.
pub fn group_leader(&self) -> &Task {
// SAFETY: By the type invariant, we know that `self.0` is a valid task. Valid tasks always
- // have a valid group_leader.
+ // have a valid `group_leader`.
let ptr = unsafe { *ptr::addr_of!((*self.0.get()).group_leader) };
// SAFETY: The lifetime of the returned task reference is tied to the lifetime of `self`,
diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs
index 8775c34d12a5..d900dc911149 100644
--- a/rust/kernel/workqueue.rs
+++ b/rust/kernel/workqueue.rs
@@ -168,7 +168,7 @@ impl Queue {
/// # Safety
///
/// The caller must ensure that the provided raw pointer is not dangling, that it points at a
- /// valid workqueue, and that it remains valid until the end of 'a.
+ /// valid workqueue, and that it remains valid until the end of `'a`.
pub unsafe fn from_raw<'a>(ptr: *const bindings::workqueue_struct) -> &'a Queue {
// SAFETY: The `Queue` type is `#[repr(transparent)]`, so the pointer cast is valid. The
// caller promises that the pointer is not dangling.
@@ -414,8 +414,8 @@ pub unsafe fn raw_get(ptr: *const Self) -> *mut bindings::work_struct {
///
/// # Safety
///
-/// The [`OFFSET`] constant must be the offset of a field in Self of type [`Work<T, ID>`]. The methods on
-/// this trait must have exactly the behavior that the definitions given below have.
+/// The [`OFFSET`] constant must be the offset of a field in `Self` of type [`Work<T, ID>`]. The
+/// methods on this trait must have exactly the behavior that the definitions given below have.
///
/// [`Work<T, ID>`]: Work
/// [`impl_has_work!`]: crate::impl_has_work
@@ -428,7 +428,8 @@ pub unsafe trait HasWork<T, const ID: u64 = 0> {
/// Returns the offset of the [`Work<T, ID>`] field.
///
- /// This method exists because the [`OFFSET`] constant cannot be accessed if the type is not Sized.
+ /// This method exists because the [`OFFSET`] constant cannot be accessed if the type is not
+ /// `Sized`.
///
/// [`Work<T, ID>`]: Work
/// [`OFFSET`]: HasWork::OFFSET
--
2.43.0
next prev parent reply other threads:[~2024-01-16 23:10 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 16:01 [PATCH 00/13] rust: kernel: documentation improvements Valentin Obst
2024-01-16 16:01 ` [PATCH 01/13] rust: kernel: fix multiple typos in documentation Valentin Obst
2024-01-18 1:47 ` Trevor Gross
2024-01-16 16:01 ` [PATCH 02/13] rust: error: move unsafe block into function call Valentin Obst
2024-01-18 0:31 ` Trevor Gross
2024-01-18 8:10 ` Valentin Obst
2024-01-16 16:01 ` [PATCH 03/13] rust: ioctl: end top level module docs with full stop Valentin Obst
2024-01-18 0:32 ` Trevor Gross
2024-01-18 1:08 ` Trevor Gross
2024-01-16 22:04 ` [PATCH 04/13] rust: kernel: add srctree-relative doclinks Valentin Obst
2024-01-18 0:38 ` Trevor Gross
2024-01-18 8:30 ` Valentin Obst
2024-01-16 22:05 ` [PATCH 05/13] rust: str: use `NUL` instead of 0 in doc comments Valentin Obst
2024-01-18 0:39 ` Trevor Gross
2024-01-16 22:06 ` [PATCH 06/13] rust: str: move SAFETY comment in front of unsafe block Valentin Obst
2024-01-18 0:48 ` Trevor Gross
2024-01-16 22:06 ` [PATCH 07/13] rust: kernel: unify spelling of refcount in docs Valentin Obst
2024-01-18 1:05 ` Trevor Gross
2024-01-16 23:09 ` Valentin Obst [this message]
2024-01-18 1:10 ` [PATCH 08/13] rust: kernel: mark code fragments in docs with backticks Trevor Gross
2024-01-16 23:10 ` [PATCH 09/13] rust: kernel: add blank lines in front of code blocks Valentin Obst
2024-01-18 1:11 ` Trevor Gross
2024-01-16 23:11 ` [PATCH 10/13] rust: kernel: add doclinks Valentin Obst
2024-01-18 1:42 ` Trevor Gross
2024-01-18 8:41 ` Valentin Obst
2024-01-16 23:11 ` [PATCH 11/13] rust: kernel: add doclinks with html tags Valentin Obst
2024-01-17 1:47 ` Martin Rodriguez Reboredo
2024-01-17 9:10 ` Valentin Obst
2024-01-17 21:41 ` Martin Rodriguez Reboredo
2024-01-18 2:28 ` Trevor Gross
2024-01-18 9:14 ` Valentin Obst
2024-01-17 0:15 ` [PATCH 12/13] rust: kernel: remove unneeded doclink targets Valentin Obst
2024-01-18 1:14 ` Trevor Gross
2024-01-18 1:21 ` Trevor Gross
2024-01-17 0:16 ` [PATCH 13/13] rust: locked_by: shorten doclink preview Valentin Obst
2024-01-18 1:18 ` Trevor Gross
2024-01-30 9:18 ` Alice Ryhl
2024-01-17 1:41 ` [PATCH 00/13] rust: kernel: documentation improvements Martin Rodriguez Reboredo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240116230951.168808-1-kernel@valentinobst.de \
--to=kernel@valentinobst.de \
--cc=a.hindborg@samsung.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=wedsonaf@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).