Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing \n in printing calls such as pr_*! and dev_*! #1139

Open
ojeda opened this issue Jan 19, 2025 · 3 comments
Open

Fix missing \n in printing calls such as pr_*! and dev_*! #1139

ojeda opened this issue Jan 19, 2025 · 3 comments
Labels
easy Expected to be an easy issue to resolve. good first issue Good for newcomers • lib Related to the `rust/` library.

Comments

@ojeda
Copy link
Member

ojeda commented Jan 19, 2025

Fix missing \n in printing calls such as pr_*! and dev_*!.


This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Reported-by: tag, a Closes: tag to this issue and a Fixes: tag to the relevant commit. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.

Please take this issue only if you are new to the kernel development process and you would like to use it as a test to submit your first patch to the kernel. Please do not take it if you do not plan to make other contributions to the kernel.

@ojeda ojeda added easy Expected to be an easy issue to resolve. good first issue Good for newcomers • lib Related to the `rust/` library. labels Jan 19, 2025
@albankurti
Copy link

First time looking at issues for the project, but I wasn't able to find any missing \n in any printing calls other than in the documentation examples, I looked at the rust/ directory, am I missing something?

@charmitro
Copy link

First time looking at issues for the project, but I wasn't able to find any missing \n in any printing calls other than in the documentation examples, I looked at the rust/ directory, am I missing something?

@albankurti also check the samples directory, samples/rust/*.rs.

@albankurti
Copy link

albankurti commented Feb 3, 2025

Emailed fix for what I found in samples/

intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Feb 6, 2025
Fix adding a newline at the end of the usage of pr_info! in the
documentation

Fixes: e3c3d34 ("docs: rust: Add description of Rust documentation test as KUnit ones")
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: Rust-for-Linux#1139
Signed-off-by: Alban Kurti <kurti@invicto.ai>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Feb 6, 2025
Added missing newline at the end of pr_warn! usage
so the log is not missed.

Fixes: 6551a7f ("rust: error: Add Error::from_errno{_unchecked}()")
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: Rust-for-Linux#1139
Signed-off-by: Alban Kurti <kurti@invicto.ai>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Feb 6, 2025
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: 6841d45 ("rust: init: add `stack_pin_init!` macro")
Fixes: 7f8977a ("rust: init: add `{pin_}chain` functions to `{Pin}Init<T, E>`")
Fixes: d0fdc39 ("rust: init: add `PinnedDrop` trait and macros")
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: Rust-for-Linux#1139
Signed-off-by: Alban Kurti <kurti@invicto.ai>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Feb 6, 2025
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: 7b1f55e ("rust: sync: introduce `LockedBy`")
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: Rust-for-Linux#1139
Signed-off-by: Alban Kurti <kurti@invicto.ai>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Feb 6, 2025
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: 15b286d ("rust: workqueue: add examples")
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: Rust-for-Linux#1139
Signed-off-by: Alban Kurti <kurti@invicto.ai>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Feb 6, 2025
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: f431c5c ("samples: rust: print: Add sample code for Arc printing")
Fixes: 47cb6bf ("rust: use derive(CoercePointee) on rustc >= 1.84.0")
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: Rust-for-Linux#1139
Signed-off-by: Alban Kurti <kurti@invicto.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Expected to be an easy issue to resolve. good first issue Good for newcomers • lib Related to the `rust/` library.
Development

No branches or pull requests

3 participants