* [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls
@ 2025-02-06 21:07 Alban Kurti
2025-02-06 21:07 ` [PATCH v3 1/6] rust: docs: add missing newline to printing macro examples Alban Kurti
` (6 more replies)
0 siblings, 7 replies; 12+ messages in thread
From: Alban Kurti @ 2025-02-06 21:07 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding
Cc: rust-for-linux, linux-doc, linux-kernel, Alban Kurti,
Martin Rodriguez Reboredo, Fox Chen
Adding newline at the end of all Rust pr_* and dev_* macro
calls that miss a newline.
`pr_*!` and `dev_*!` macros are supposed to be called
with a newline at the end, just like in the C side
such that independent lines are not visually missed.
There were no dev_*! cases with a missing newline found.
Signed-off-by: Alban Kurti <kurti@invicto.ai>
---
Changes in v3:
- Same code changes to v2, but split patches into multiple patches
and improved the descriptions
---
Alban Kurti (6):
rust: docs: add missing newline to printing macro examples
rust: error: add missing newline to pr_warn! calls
rust: init: add missing newline to pr_info! calls
rust: sync: add missing newline in locked_by log example
rust: workqueue: add missing newline to pr_info! examples
rust: samples: add missing newline to pr_info! calls in rust_print_main
Documentation/rust/testing.rst | 2 +-
rust/kernel/error.rs | 2 +-
rust/kernel/init.rs | 12 ++++++------
rust/kernel/init/macros.rs | 6 +++---
rust/kernel/sync/locked_by.rs | 2 +-
rust/kernel/workqueue.rs | 6 +++---
samples/rust/rust_print_main.rs | 8 ++++----
7 files changed, 19 insertions(+), 19 deletions(-)
---
base-commit: ceff0757f5dafb5be5205988171809c877b1d3e3
change-id: 20250206-printing_fix-e7a7950b9e7c
Best regards,
--
Alban Kurti <kurti@invicto.ai>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 1/6] rust: docs: add missing newline to printing macro examples
2025-02-06 21:07 [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Alban Kurti
@ 2025-02-06 21:07 ` Alban Kurti
2025-02-07 7:37 ` David Gow
2025-02-06 21:07 ` [PATCH v3 2/6] rust: error: add missing newline to pr_warn! calls Alban Kurti
` (5 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Alban Kurti @ 2025-02-06 21:07 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding
Cc: rust-for-linux, linux-doc, linux-kernel, Alban Kurti,
Martin Rodriguez Reboredo, Fox Chen
Fix adding a newline at the end of the usage of pr_info! in the
documentation
Fixes: e3c3d34507c7 ("docs: rust: Add description of Rust documentation test as KUnit ones")
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>
---
Documentation/rust/testing.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/rust/testing.rst b/Documentation/rust/testing.rst
index 568b71b415a4525772cb77ce76c7f9da32fac1c4..180b886e0f1ee997779f04ce85eba858e64946c0 100644
--- a/Documentation/rust/testing.rst
+++ b/Documentation/rust/testing.rst
@@ -97,7 +97,7 @@ operator are also supported as usual, e.g.:
/// ```
/// # use kernel::{spawn_work_item, workqueue};
- /// spawn_work_item!(workqueue::system(), || pr_info!("x"))?;
+ /// spawn_work_item!(workqueue::system(), || pr_info!("x\n"))?;
/// # Ok::<(), Error>(())
/// ```
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 2/6] rust: error: add missing newline to pr_warn! calls
2025-02-06 21:07 [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Alban Kurti
2025-02-06 21:07 ` [PATCH v3 1/6] rust: docs: add missing newline to printing macro examples Alban Kurti
@ 2025-02-06 21:07 ` Alban Kurti
2025-02-06 21:07 ` [PATCH v3 3/6] rust: init: add missing newline to pr_info! calls Alban Kurti
` (4 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Alban Kurti @ 2025-02-06 21:07 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding
Cc: rust-for-linux, linux-doc, linux-kernel, Alban Kurti,
Martin Rodriguez Reboredo, Fox Chen
Added missing newline at the end of pr_warn! usage
so the log is not missed.
Fixes: 6551a7fe0acb ("rust: error: Add Error::from_errno{_unchecked}()")
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/error.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
index f6ecf09cb65f4ebe9b88da68b3830ae79aa4f182..a194d83e6835c03b84cc849b641ce8fff548047d 100644
--- a/rust/kernel/error.rs
+++ b/rust/kernel/error.rs
@@ -107,7 +107,7 @@ pub fn from_errno(errno: crate::ffi::c_int) -> Error {
} else {
// TODO: Make it a `WARN_ONCE` once available.
crate::pr_warn!(
- "attempted to create `Error` with out of range `errno`: {}",
+ "attempted to create `Error` with out of range `errno`: {}\n",
errno
);
code::EINVAL
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 3/6] rust: init: add missing newline to pr_info! calls
2025-02-06 21:07 [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Alban Kurti
2025-02-06 21:07 ` [PATCH v3 1/6] rust: docs: add missing newline to printing macro examples Alban Kurti
2025-02-06 21:07 ` [PATCH v3 2/6] rust: error: add missing newline to pr_warn! calls Alban Kurti
@ 2025-02-06 21:07 ` Alban Kurti
2025-02-06 21:07 ` [PATCH v3 4/6] rust: sync: add missing newline in locked_by log example Alban Kurti
` (3 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Alban Kurti @ 2025-02-06 21:07 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding
Cc: rust-for-linux, linux-doc, linux-kernel, Alban Kurti,
Martin Rodriguez Reboredo, Fox Chen
Several pr_info! calls in rust/kernel/init.rs (both in code examples
and macro documentation) were missing a newline, causing logs to
run together. This commit updates these calls to include a trailing
newline, improving readability and consistency with the C side.
Fixes: 6841d45a3030 ("rust: init: add `stack_pin_init!` macro")
Fixes: 7f8977a7fe6d ("rust: init: add `{pin_}chain` functions to `{Pin}Init<T, E>`")
Fixes: d0fdc3961270 ("rust: init: add `PinnedDrop` trait and macros")
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/init.rs | 12 ++++++------
rust/kernel/init/macros.rs | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs
index 3f9236c1c9d56db33aea4b76f8116175b9b6ce23..8f57d164cdec8aee6c07e258a512ff8171a1b065 100644
--- a/rust/kernel/init.rs
+++ b/rust/kernel/init.rs
@@ -259,7 +259,7 @@
/// },
/// }));
/// let foo: Pin<&mut Foo> = foo;
-/// pr_info!("a: {}", &*foo.a.lock());
+/// pr_info!("a: {}\n", &*foo.a.lock());
/// ```
///
/// # Syntax
@@ -319,7 +319,7 @@ macro_rules! stack_pin_init {
/// }, GFP_KERNEL)?,
/// }));
/// let foo = foo.unwrap();
-/// pr_info!("a: {}", &*foo.a.lock());
+/// pr_info!("a: {}\n", &*foo.a.lock());
/// ```
///
/// ```rust,ignore
@@ -352,7 +352,7 @@ macro_rules! stack_pin_init {
/// x: 64,
/// }, GFP_KERNEL)?,
/// }));
-/// pr_info!("a: {}", &*foo.a.lock());
+/// pr_info!("a: {}\n", &*foo.a.lock());
/// # Ok::<_, AllocError>(())
/// ```
///
@@ -882,7 +882,7 @@ pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
///
/// impl Foo {
/// fn setup(self: Pin<&mut Self>) {
- /// pr_info!("Setting up foo");
+ /// pr_info!("Setting up foo\n");
/// }
/// }
///
@@ -986,7 +986,7 @@ pub unsafe trait Init<T: ?Sized, E = Infallible>: PinInit<T, E> {
///
/// impl Foo {
/// fn setup(&mut self) {
- /// pr_info!("Setting up foo");
+ /// pr_info!("Setting up foo\n");
/// }
/// }
///
@@ -1336,7 +1336,7 @@ fn write_pin_init<E>(mut self, init: impl PinInit<T, E>) -> Result<Pin<Self::Ini
/// #[pinned_drop]
/// impl PinnedDrop for Foo {
/// fn drop(self: Pin<&mut Self>) {
-/// pr_info!("Foo is being dropped!");
+/// pr_info!("Foo is being dropped!\n");
/// }
/// }
/// ```
diff --git a/rust/kernel/init/macros.rs b/rust/kernel/init/macros.rs
index 1fd146a832416514a2bdcb269615509d75e3a559..b7213962a6a5ac167c445a4fdc77f3661639121d 100644
--- a/rust/kernel/init/macros.rs
+++ b/rust/kernel/init/macros.rs
@@ -45,7 +45,7 @@
//! #[pinned_drop]
//! impl PinnedDrop for Foo {
//! fn drop(self: Pin<&mut Self>) {
-//! pr_info!("{self:p} is getting dropped.");
+//! pr_info!("{self:p} is getting dropped.\n");
//! }
//! }
//!
@@ -412,7 +412,7 @@
//! #[pinned_drop]
//! impl PinnedDrop for Foo {
//! fn drop(self: Pin<&mut Self>) {
-//! pr_info!("{self:p} is getting dropped.");
+//! pr_info!("{self:p} is getting dropped.\n");
//! }
//! }
//! ```
@@ -423,7 +423,7 @@
//! // `unsafe`, full path and the token parameter are added, everything else stays the same.
//! unsafe impl ::kernel::init::PinnedDrop for Foo {
//! fn drop(self: Pin<&mut Self>, _: ::kernel::init::__internal::OnlyCallFromDrop) {
-//! pr_info!("{self:p} is getting dropped.");
+//! pr_info!("{self:p} is getting dropped.\n");
//! }
//! }
//! ```
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 4/6] rust: sync: add missing newline in locked_by log example
2025-02-06 21:07 [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Alban Kurti
` (2 preceding siblings ...)
2025-02-06 21:07 ` [PATCH v3 3/6] rust: init: add missing newline to pr_info! calls Alban Kurti
@ 2025-02-06 21:07 ` Alban Kurti
2025-02-06 21:07 ` [PATCH v3 5/6] rust: workqueue: add missing newline to pr_info! examples Alban Kurti
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Alban Kurti @ 2025-02-06 21:07 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding
Cc: rust-for-linux, linux-doc, linux-kernel, Alban Kurti,
Martin Rodriguez Reboredo, Fox Chen
The pr_info! example in rust/kernel/sync/locked_by.rs was missing
a newline. This patch appends the missing newline to ensure
that log messages for locked resources display correctly.
Fixes: 7b1f55e3a984 ("rust: sync: introduce `LockedBy`")
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/sync/locked_by.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/sync/locked_by.rs b/rust/kernel/sync/locked_by.rs
index a7b244675c2b96a36a6fe2e3ddd9a68e6ea01cb7..61f100a45b3507c750c1e3c405f9a8f67ced5346 100644
--- a/rust/kernel/sync/locked_by.rs
+++ b/rust/kernel/sync/locked_by.rs
@@ -55,7 +55,7 @@
/// fn print_bytes_used(dir: &Directory, file: &File) {
/// let guard = dir.inner.lock();
/// let inner_file = file.inner.access(&guard);
-/// pr_info!("{} {}", guard.bytes_used, inner_file.bytes_used);
+/// pr_info!("{} {}\n", guard.bytes_used, inner_file.bytes_used);
/// }
///
/// /// Increments `bytes_used` for both the directory and file.
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 5/6] rust: workqueue: add missing newline to pr_info! examples
2025-02-06 21:07 [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Alban Kurti
` (3 preceding siblings ...)
2025-02-06 21:07 ` [PATCH v3 4/6] rust: sync: add missing newline in locked_by log example Alban Kurti
@ 2025-02-06 21:07 ` Alban Kurti
2025-02-07 9:36 ` Alice Ryhl
2025-02-06 21:07 ` [PATCH v3 6/6] rust: samples: add missing newline to pr_info! calls in rust_print_main Alban Kurti
2025-03-06 19:46 ` [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Miguel Ojeda
6 siblings, 1 reply; 12+ messages in thread
From: Alban Kurti @ 2025-02-06 21:07 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding
Cc: rust-for-linux, linux-doc, linux-kernel, Alban Kurti,
Martin Rodriguez Reboredo, Fox Chen
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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 6/6] rust: samples: add missing newline to pr_info! calls in rust_print_main
2025-02-06 21:07 [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Alban Kurti
` (4 preceding siblings ...)
2025-02-06 21:07 ` [PATCH v3 5/6] rust: workqueue: add missing newline to pr_info! examples Alban Kurti
@ 2025-02-06 21:07 ` Alban Kurti
2025-03-05 23:55 ` Miguel Ojeda
2025-03-06 19:46 ` [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Miguel Ojeda
6 siblings, 1 reply; 12+ messages in thread
From: Alban Kurti @ 2025-02-06 21:07 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding
Cc: rust-for-linux, linux-doc, linux-kernel, Alban Kurti,
Martin Rodriguez Reboredo, Fox Chen
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@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 | 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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 1/6] rust: docs: add missing newline to printing macro examples
2025-02-06 21:07 ` [PATCH v3 1/6] rust: docs: add missing newline to printing macro examples Alban Kurti
@ 2025-02-07 7:37 ` David Gow
0 siblings, 0 replies; 12+ messages in thread
From: David Gow @ 2025-02-07 7:37 UTC (permalink / raw)
To: Alban Kurti
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding, rust-for-linux, linux-doc,
linux-kernel, Martin Rodriguez Reboredo, Fox Chen
[-- Attachment #1: Type: text/plain, Size: 1240 bytes --]
On Fri, 7 Feb 2025 at 05:08, Alban Kurti <kurti@invicto.ai> wrote:
>
> Fix adding a newline at the end of the usage of pr_info! in the
> documentation
>
> Fixes: e3c3d34507c7 ("docs: rust: Add description of Rust documentation test as KUnit ones")
> 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>
> ---
Looks fine to me as a fix for the KUnit/testing docs.
Reviewed-by: David Gow <davidgow@google.com>
Cheers,
-- David
> Documentation/rust/testing.rst | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/rust/testing.rst b/Documentation/rust/testing.rst
> index 568b71b415a4525772cb77ce76c7f9da32fac1c4..180b886e0f1ee997779f04ce85eba858e64946c0 100644
> --- a/Documentation/rust/testing.rst
> +++ b/Documentation/rust/testing.rst
> @@ -97,7 +97,7 @@ operator are also supported as usual, e.g.:
>
> /// ```
> /// # use kernel::{spawn_work_item, workqueue};
> - /// spawn_work_item!(workqueue::system(), || pr_info!("x"))?;
> + /// spawn_work_item!(workqueue::system(), || pr_info!("x\n"))?;
> /// # Ok::<(), Error>(())
> /// ```
>
>
> --
> 2.48.1
>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5294 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 5/6] rust: workqueue: add missing newline to pr_info! examples
2025-02-06 21:07 ` [PATCH v3 5/6] rust: workqueue: add missing newline to pr_info! examples Alban Kurti
@ 2025-02-07 9:36 ` Alice Ryhl
0 siblings, 0 replies; 12+ messages in thread
From: Alice Ryhl @ 2025-02-07 9:36 UTC (permalink / raw)
To: Alban Kurti
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding, rust-for-linux, linux-doc,
linux-kernel, Martin Rodriguez Reboredo, Fox Chen
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>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 6/6] rust: samples: add missing newline to pr_info! calls in rust_print_main
2025-02-06 21:07 ` [PATCH v3 6/6] rust: samples: add missing newline to pr_info! calls in rust_print_main Alban Kurti
@ 2025-03-05 23:55 ` Miguel Ojeda
2025-04-13 20:52 ` Miguel Ojeda
0 siblings, 1 reply; 12+ messages in thread
From: Miguel Ojeda @ 2025-03-05 23:55 UTC (permalink / raw)
To: Alban Kurti
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding, rust-for-linux, linux-doc,
linux-kernel, Martin Rodriguez Reboredo, Fox Chen
On Thu, Feb 6, 2025 at 10:08 PM Alban Kurti <kurti@invicto.ai> wrote:
>
> Fixes: f431c5c581fa ("samples: rust: print: Add sample code for Arc printing")
> Fixes: 47cb6bf7860c ("rust: use derive(CoercePointee) on rustc >= 1.84.0")
Thanks Alban for making the effort of splitting the patch into several
and finding the right commits to tag.
I will take the first 5 patches already, but I think this last one in
particular will need to be split, because one Fixes tag points to some
LTSs and the other is very recent, so it wouldn't be backported.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls
2025-02-06 21:07 [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Alban Kurti
` (5 preceding siblings ...)
2025-02-06 21:07 ` [PATCH v3 6/6] rust: samples: add missing newline to pr_info! calls in rust_print_main Alban Kurti
@ 2025-03-06 19:46 ` Miguel Ojeda
6 siblings, 0 replies; 12+ messages in thread
From: Miguel Ojeda @ 2025-03-06 19:46 UTC (permalink / raw)
To: Alban Kurti
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding, rust-for-linux, linux-doc,
linux-kernel, Martin Rodriguez Reboredo, Fox Chen
On Thu, Feb 6, 2025 at 10:08 PM Alban Kurti <kurti@invicto.ai> wrote:
>
> rust: docs: add missing newline to printing macro examples
> rust: error: add missing newline to pr_warn! calls
> rust: init: add missing newline to pr_info! calls
> rust: sync: add missing newline in locked_by log example
> rust: workqueue: add missing newline to pr_info! examples
Applied these (i.e. the first 5) to `rust-fixes` -- thanks everyone!
[ Replaced Closes with Link since it fixes part of the issue. - Miguel ]
[ Replaced Closes with Link since it fixes part of the issue. - Miguel ]
[ Replaced Closes with Link since it fixes part of the issue. Added
one more Fixes tag (still same set of stable kernels). - Miguel ]
[ Replaced Closes with Link since it fixes part of the issue. - Miguel ]
[ Replaced Closes with Link since it fixes part of the issue. - Miguel ]
Alban: please feel free to send the last one split (please see my
other message) -- thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 6/6] rust: samples: add missing newline to pr_info! calls in rust_print_main
2025-03-05 23:55 ` Miguel Ojeda
@ 2025-04-13 20:52 ` Miguel Ojeda
0 siblings, 0 replies; 12+ messages in thread
From: Miguel Ojeda @ 2025-04-13 20:52 UTC (permalink / raw)
To: Alban Kurti
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Jonathan Corbet, David Gow, Dirk Behme, Asahi Lina,
Wedson Almeida Filho, Wedson Almeida Filho,
Andreas Hindborg (Samsung), Tejun Heo, Fiona Behrens,
Vincenzo Palazzo, Xiangfei Ding, rust-for-linux, linux-doc,
linux-kernel, Martin Rodriguez Reboredo, Fox Chen
On Thu, Mar 6, 2025 at 12:55 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Thanks Alban for making the effort of splitting the patch into several
> and finding the right commits to tag.
>
> I will take the first 5 patches already, but I think this last one in
> particular will need to be split, because one Fixes tag points to some
> LTSs and the other is very recent, so it wouldn't be backported.
Ping about this -- thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-04-13 20:53 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 21:07 [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Alban Kurti
2025-02-06 21:07 ` [PATCH v3 1/6] rust: docs: add missing newline to printing macro examples Alban Kurti
2025-02-07 7:37 ` David Gow
2025-02-06 21:07 ` [PATCH v3 2/6] rust: error: add missing newline to pr_warn! calls Alban Kurti
2025-02-06 21:07 ` [PATCH v3 3/6] rust: init: add missing newline to pr_info! calls Alban Kurti
2025-02-06 21:07 ` [PATCH v3 4/6] rust: sync: add missing newline in locked_by log example Alban Kurti
2025-02-06 21:07 ` [PATCH v3 5/6] rust: workqueue: add missing newline to pr_info! examples Alban Kurti
2025-02-07 9:36 ` Alice Ryhl
2025-02-06 21:07 ` [PATCH v3 6/6] rust: samples: add missing newline to pr_info! calls in rust_print_main Alban Kurti
2025-03-05 23:55 ` Miguel Ojeda
2025-04-13 20:52 ` Miguel Ojeda
2025-03-06 19:46 ` [PATCH v3 0/6] rust: treewide: add missing newlines to printing calls Miguel Ojeda
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).