lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250206-printing_fix-v3-6-a85273b501ae@invicto.ai>
Date: Thu, 06 Feb 2025 21:07:57 +0000 (UTC)
From: Alban Kurti <kurti@...icto.ai>
To: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, 
 Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
 Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
 Benno Lossin <benno.lossin@...ton.me>, 
 Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>, 
 Trevor Gross <tmgross@...ch.edu>, Jonathan Corbet <corbet@....net>, 
 David Gow <davidgow@...gle.com>, Dirk Behme <dirk.behme@...bosch.com>, 
 Asahi Lina <lina@...hilina.net>, Wedson Almeida Filho <wedsonaf@...il.com>, 
 Wedson Almeida Filho <walmeida@...rosoft.com>, 
 "Andreas Hindborg (Samsung)" <nmi@...aspace.dk>, Tejun Heo <tj@...nel.org>, 
 Fiona Behrens <me@...enk.dev>, 
 Vincenzo Palazzo <vincenzopalazzodev@...il.com>, 
 Xiangfei Ding <dingxiangfei2009@...il.com>
Cc: rust-for-linux@...r.kernel.org, linux-doc@...r.kernel.org, 
 linux-kernel@...r.kernel.org, Alban Kurti <kurti@...icto.ai>, 
 Martin Rodriguez Reboredo <yakoyoku@...il.com>, 
 Fox Chen <foxhlchen@...il.com>
Subject: [PATCH v3 6/6] rust: samples: add missing newline to pr_info!
 calls in rust_print_main

The sample code in samples/rust/rust_print_main.rs contained pr_info!
calls without a newline. This commit updates those calls, ensuring
that the output is properly formatted when the sample is run.

Fixes: f431c5c581fa ("samples: rust: print: Add sample code for Arc printing")
Fixes: 47cb6bf7860c ("rust: use derive(CoercePointee) on rustc >= 1.84.0")
Reported-by: Miguel Ojeda <ojeda@...nel.org>
Closes: https://github.com/Rust-for-Linux/linux/issues/1139
Signed-off-by: Alban Kurti <kurti@...icto.ai>
---
 samples/rust/rust_print_main.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/samples/rust/rust_print_main.rs b/samples/rust/rust_print_main.rs
index 7e8af5f176a33925881c7d65b34c823028b7b93b..7ef3cecc65a15627276699c691273608253c9df5 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();
@@ -42,7 +42,7 @@ fn arc_print() -> Result {
 
         use core::fmt::Display;
         fn arc_dyn_print(arc: &Arc<dyn Display>) {
-            pr_info!("Arc<dyn Display> says {arc}");
+            pr_info!("Arc<dyn Display> says {arc}\n");
         }
 
         let a_i32_display: Arc<dyn Display> = Arc::new(42i32, GFP_KERNEL)?;
@@ -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.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ