]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rust: module_param: use `pr_warn_once!` for null pointer warning
authorAndreas Hindborg <a.hindborg@kernel.org>
Mon, 27 Apr 2026 08:11:35 +0000 (10:11 +0200)
committerSami Tolvanen <samitolvanen@google.com>
Wed, 27 May 2026 00:20:39 +0000 (00:20 +0000)
Replace `pr_warn!` and the accompanying TODO with `pr_warn_once!`, now that
the macro is available.

[ Note: Adarsh Das independently authored an identical patch on the
  rust-for-linux list, but it missed the modules tree. ]

Suggested-by: Adarsh Das <adarshdas950@gmail.com>
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
rust/kernel/module_param.rs

index 6a8a7a875643a4ac8fd92e7e06758ea956b05e18..dd6d663a0a3c4819d4242e4767e60acfc6d8848b 100644 (file)
@@ -62,8 +62,7 @@ where
     // NOTE: If we start supporting arguments without values, val _is_ allowed
     // 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_once!("Null pointer passed to `module_param::set_param`");
         return EINVAL.to_errno();
     }