[PATCH] rust: module_param: add missing newline to pr_warn

Kenny Glowner posted 1 patch 3 days, 3 hours ago
rust/kernel/module_param.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] rust: module_param: add missing newline to pr_warn
Posted by Kenny Glowner 3 days, 3 hours ago
Add a trailing newline ('\n') to the pr_warn! call in set_param to
ensure the kernel ring buffer flushes the message correctly and
prevents log line smearing.

Link: https://github.com/Rust-for-Linux/linux/issues/1139

Signed-off-by: Kenny Glowner <SisyphusCode0311@gmail.com>
---
 rust/kernel/module_param.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/module_param.rs b/rust/kernel/module_param.rs
index 6a8a7a875643..fa26089be2e0 100644
--- a/rust/kernel/module_param.rs
+++ b/rust/kernel/module_param.rs
@@ -63,7 +63,7 @@ pub trait ModuleParam: Sized + Copy {
     // to be null here.
     if val.is_null() {
         // TODO: Use pr_warn_once available.
-        crate::pr_warn!("Null pointer passed to `module_param::set_param`");
+        crate::pr_warn!("Null pointer passed to `module_param::set_param`\n");
         return EINVAL.to_errno();
     }
 
-- 
2.54.0