mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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 <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>
This commit is contained in:
parent
04e17ca3f7
commit
ac2f40107c
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user