[PATCH v4 1/2] rust: samples: add missing newline to pr_info! calls in rust_print_main

Alban Kurti via B4 Relay posted 2 patches 9 months, 1 week ago
[PATCH v4 1/2] rust: samples: add missing newline to pr_info! calls in rust_print_main
Posted by Alban Kurti via B4 Relay 9 months, 1 week ago
From: Alban Kurti <kurti@invicto.ai>

Fixes: f431c5c581fa ("samples: rust: print: Add sample code for Arc printing")
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>
---
 samples/rust/rust_print_main.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/samples/rust/rust_print_main.rs b/samples/rust/rust_print_main.rs
index 8ea95e8c2f3647650577c4e9dab853e0e3a8bf20..899a6d25f4dc0e0ccebdf4f95aaaf780b425e3af 100644
--- a/samples/rust/rust_print_main.rs
+++ b/samples/rust/rust_print_main.rs
@@ -23,10 +23,10 @@ fn arc_print() -> Result {
     let b = UniqueArc::new("hello, world", GFP_KERNEL)?;
 
     // Prints the value of data in `a`.
-    pr_info!("{}", a);
+    pr_info!("{}\n", a);
 
     // Uses ":?" to print debug fmt of `b`.
-    pr_info!("{:?}", b);
+    pr_info!("{:?}\n", b);
 
     let a: Arc<&str> = b.into();
     let c = a.clone();
@@ -53,7 +53,7 @@ fn arc_dyn_print(arc: &Arc<dyn Display>) {
     }
 
     // Pretty-prints the debug formatting with lower-case hexadecimal integers.
-    pr_info!("{:#x?}", a);
+    pr_info!("{:#x?}\n", a);
 
     Ok(())
 }

-- 
2.49.0
Re: [PATCH v4 1/2] rust: samples: add missing newline to pr_info! calls in rust_print_main
Posted by Miguel Ojeda 9 months, 1 week ago
On Sun, May 4, 2025 at 5:41 PM Alban Kurti via B4 Relay
<devnull+kurti.invicto.ai@kernel.org> wrote:
>
> From: Alban Kurti <kurti@invicto.ai>
>
> Fixes: f431c5c581fa ("samples: rust: print: Add sample code for Arc printing")
> 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>

Commit messages cannot be empty, even if they may be apparently
trivial -- could you please describe the changes a bit? (i.e. "what"
and "why").

Also, I think you sent two patches with the exact same title -- I
think you did it because the Fixes tag is different, which is good.
However, you could mention the difference in the title and message?
For instance:

    rust: samples: rust_print_main: add missing newline in basic pr_info! calls
    rust: samples: rust_print_main: add missing newline in Arc<dyn>
pr_info! call

Thanks for sending these fixes!

Cheers,
Miguel