[PATCH] rust: module_param: use pr_warn_once! for null pointer warning

Maurice Hieronymus posted 1 patch 1 day, 10 hours ago
rust/kernel/module_param.rs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] rust: module_param: use pr_warn_once! for null pointer warning
Posted by Maurice Hieronymus 1 day, 10 hours ago
This resolves the existing TODO that asked for pr_warn_once! once
it became available.

Signed-off-by: Maurice Hieronymus <mhi@mailbox.org>
---
 rust/kernel/module_param.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/rust/kernel/module_param.rs b/rust/kernel/module_param.rs
index 6a8a7a875643..dd6d663a0a3c 100644
--- a/rust/kernel/module_param.rs
+++ b/rust/kernel/module_param.rs
@@ -62,8 +62,7 @@ pub trait ModuleParam: Sized + Copy {
     // 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();
     }
 

---
base-commit: 838a0871cb3cf5988560d17afaaf57592bdb486b
change-id: 20260606-module-param-pr-warn-once-ed2f548ea741

Best regards,
-- 
Maurice Hieronymus <mhi@mailbox.org>
Re: [PATCH] rust: module_param: use pr_warn_once! for null pointer warning
Posted by Miguel Ojeda 1 day, 8 hours ago
On Sat, Jun 6, 2026 at 8:24 PM Maurice Hieronymus <mhi@mailbox.org> wrote:
>
> This resolves the existing TODO that asked for pr_warn_once! once
> it became available.
>
> Signed-off-by: Maurice Hieronymus <mhi@mailbox.org>

Thanks for the patch!

This was already sent and applied, please see commit:

  ac2f40107cf1 ("rust: module_param: use `pr_warn_once!` for null
pointer warning")

in linux-next.

Cheers,
Miguel