Skip to content

Commit 7f87c7a

Browse files
Peter Novakojeda
authored andcommitted
rust: use consistent backtick formatting for NULL in docs
Some doc comments use `NULL` while others use plain NULL. Make it consistent by adding backticks everywhere, matching the majority of existing usage. Signed-off-by: Peter Novak <seimun018r@gmail.com> Acked-by: Stephen Boyd <sboyd@kernel.org> Acked-by: David Gow <davidgow@google.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20251130211233.367946-1-seimun018r@gmail.com [ Reworded slightly. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 4b2dbf4 commit 7f87c7a

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

rust/kernel/clk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ mod common_clk {
9494
/// # Invariants
9595
///
9696
/// A [`Clk`] instance holds either a pointer to a valid [`struct clk`] created by the C
97-
/// portion of the kernel or a NULL pointer.
97+
/// portion of the kernel or a `NULL` pointer.
9898
///
9999
/// Instances of this type are reference-counted. Calling [`Clk::get`] ensures that the
100100
/// allocation remains valid for the lifetime of the [`Clk`].

rust/kernel/debugfs/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl Entry<'_> {
148148
/// # Guarantees
149149
///
150150
/// Due to the type invariant, the value returned from this function will always be an error
151-
/// code, NULL, or a live DebugFS directory. If it is live, it will remain live at least as
151+
/// code, `NULL`, or a live DebugFS directory. If it is live, it will remain live at least as
152152
/// long as this entry lives.
153153
pub(crate) fn as_ptr(&self) -> *mut bindings::dentry {
154154
self.entry

rust/kernel/kunit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub fn is_test_result_ok(t: impl TestResult) -> bool {
190190

191191
/// Represents an individual test case.
192192
///
193-
/// The [`kunit_unsafe_test_suite!`] macro expects a NULL-terminated list of valid test cases.
193+
/// The [`kunit_unsafe_test_suite!`] macro expects a `NULL`-terminated list of valid test cases.
194194
/// Use [`kunit_case_null`] to generate such a delimiter.
195195
#[doc(hidden)]
196196
pub const fn kunit_case(
@@ -212,9 +212,9 @@ pub const fn kunit_case(
212212
}
213213
}
214214

215-
/// Represents the NULL test case delimiter.
215+
/// Represents the `NULL` test case delimiter.
216216
///
217-
/// The [`kunit_unsafe_test_suite!`] macro expects a NULL-terminated list of test cases. This
217+
/// The [`kunit_unsafe_test_suite!`] macro expects a `NULL`-terminated list of test cases. This
218218
/// function returns such a delimiter.
219219
#[doc(hidden)]
220220
pub const fn kunit_case_null() -> kernel::bindings::kunit_case {
@@ -237,7 +237,7 @@ pub const fn kunit_case_null() -> kernel::bindings::kunit_case {
237237
///
238238
/// # Safety
239239
///
240-
/// `test_cases` must be a NULL terminated array of valid test cases,
240+
/// `test_cases` must be a `NULL` terminated array of valid test cases,
241241
/// whose lifetime is at least that of the test suite (i.e., static).
242242
///
243243
/// # Examples

rust/macros/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub fn module(ts: TokenStream) -> TokenStream {
154154
/// case the default implementation will never be executed. The reason for this
155155
/// is that the functions will be called through function pointers installed in
156156
/// C side vtables. When an optional method is not implemented on a `#[vtable]`
157-
/// trait, a NULL entry is installed in the vtable. Thus the default
157+
/// trait, a `NULL` entry is installed in the vtable. Thus the default
158158
/// implementation is never called. Since these traits are not designed to be
159159
/// used on the Rust side, it should not be possible to call the default
160160
/// implementation. This is done to ensure that we call the vtable methods

0 commit comments

Comments
 (0)