From: Andreas Hindborg Date: Mon, 27 Apr 2026 08:11:35 +0000 (+0200) Subject: rust: module_param: use `pr_warn_once!` for null pointer warning X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac2f40107cf1296955c867dc31b1a1eceb8ec569;p=thirdparty%2Fkernel%2Flinux.git rust: module_param: use `pr_warn_once!` for null pointer warning 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 Signed-off-by: Andreas Hindborg Reviewed-by: Aaron Tomlin Reviewed-by: Gary Guo Reviewed-by: Daniel Gomez Signed-off-by: Sami Tolvanen --- diff --git a/rust/kernel/module_param.rs b/rust/kernel/module_param.rs index 6a8a7a875643a..dd6d663a0a3c4 100644 --- a/rust/kernel/module_param.rs +++ b/rust/kernel/module_param.rs @@ -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(); }