Skip to contentSkip to conversation

rust: module_param: use pr_warn_once! for null pointer warning

PATCH In review Maurice Hieronymus 2 participants 2 messages Jun 6

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: module_param: use pr_warn_once! for null pointer warning

This resolves the existing TODO that asked for pr_warn_once! once it became available.

---
 rust/kernel/module_param.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
rust/kernel/module_param.rs +1 -2
index 6a8a7a875643..dd6d663a0a3c 100644
@@ -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,

Signature · 1 line
Maurice Hieronymus <[email protected]>
#1 lore raw
Quoted 5 lines · Maurice Hieronymus

This resolves the existing TODO that asked for pr_warn_once! once it became available.

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