[PATCH] rust: kernel: module_param: replace pr_warn with pr_warn_once

Xiaobo Liu posted 1 patch 6 days, 17 hours ago
There is a newer version of this series
rust/kernel/module_param.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] rust: kernel: module_param: replace pr_warn with pr_warn_once
Posted by Xiaobo Liu 6 days, 17 hours ago
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
---
 rust/kernel/module_param.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rust/kernel/module_param.rs b/rust/kernel/module_param.rs
index 6a8a7a875..fedb709fa 100644
--- a/rust/kernel/module_param.rs
+++ b/rust/kernel/module_param.rs
@@ -62,8 +62,8 @@ 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();
     }
 
-- 
2.34.1
Re: [PATCH] rust: kernel: module_param: replace pr_warn with pr_warn_once
Posted by Onur Özkan 6 days, 17 hours ago
On Mon, 18 May 2026 18:47:35 +0800
Xiaobo Liu <cppcoffee@gmail.com> wrote:

> Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
> ---

You need to write description for the change.

Onur

>  rust/kernel/module_param.rs | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/rust/kernel/module_param.rs b/rust/kernel/module_param.rs
> index 6a8a7a875..fedb709fa 100644
> --- a/rust/kernel/module_param.rs
> +++ b/rust/kernel/module_param.rs
> @@ -62,8 +62,8 @@ 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();
>      }
>  
> -- 
> 2.34.1
>