[PATCH v3 5/6] rust: workqueue: add missing newline to pr_info! examples

Alban Kurti posted 6 patches 1 year ago
[PATCH v3 5/6] rust: workqueue: add missing newline to pr_info! examples
Posted by Alban Kurti 1 year ago
The documentation examples in rust/kernel/workqueue.rs use pr_info!
calls that lack a trailing newline. To maintain consistency with
kernel logging practices, this patch adds the newline to all
affected examples.

Fixes: 15b286d1fd05 ("rust: workqueue: add examples")
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: https://github.com/Rust-for-Linux/linux/issues/1139
Signed-off-by: Alban Kurti <kurti@invicto.ai>
---
 rust/kernel/workqueue.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs
index 1dcd53478edda5fe8cf4e1a034865ecbf70bca79..ebc4b5b4b06db20f57a03b3330f932f279e5d0e9 100644
--- a/rust/kernel/workqueue.rs
+++ b/rust/kernel/workqueue.rs
@@ -60,7 +60,7 @@
 //!     type Pointer = Arc<MyStruct>;
 //!
 //!     fn run(this: Arc<MyStruct>) {
-//!         pr_info!("The value is: {}", this.value);
+//!         pr_info!("The value is: {}\n", this.value);
 //!     }
 //! }
 //!
@@ -108,7 +108,7 @@
 //!     type Pointer = Arc<MyStruct>;
 //!
 //!     fn run(this: Arc<MyStruct>) {
-//!         pr_info!("The value is: {}", this.value_1);
+//!         pr_info!("The value is: {}\n", this.value_1);
 //!     }
 //! }
 //!
@@ -116,7 +116,7 @@
 //!     type Pointer = Arc<MyStruct>;
 //!
 //!     fn run(this: Arc<MyStruct>) {
-//!         pr_info!("The second value is: {}", this.value_2);
+//!         pr_info!("The second value is: {}\n", this.value_2);
 //!     }
 //! }
 //!

-- 
2.48.1
Re: [PATCH v3 5/6] rust: workqueue: add missing newline to pr_info! examples
Posted by Alice Ryhl 1 year ago
On Thu, Feb 6, 2025 at 10:08 PM Alban Kurti <kurti@invicto.ai> wrote:
>
> The documentation examples in rust/kernel/workqueue.rs use pr_info!
> calls that lack a trailing newline. To maintain consistency with
> kernel logging practices, this patch adds the newline to all
> affected examples.
>
> Fixes: 15b286d1fd05 ("rust: workqueue: add examples")
> Reported-by: Miguel Ojeda <ojeda@kernel.org>
> Closes: https://github.com/Rust-for-Linux/linux/issues/1139
> Signed-off-by: Alban Kurti <kurti@invicto.ai>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>