rust: module_param: use `pr_warn_once!` for null pointer warning
Subsystems (2)
Andreas Hindborg
reviewerPATCH 1/1 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.
--- rust/kernel/module_param.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
rust/kernel/module_param.rs +1 -2
@@ -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: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260427-params-pr-once-481c03df3e2a
Best regards,
Signature · 1 line
Andreas Hindborg <[email protected]>
Quoted 4 lines · Andreas Hindborg
Replace
pr_warn!and the accompanying TODO withpr_warn_once!, now that the macro is available.Signed-off-by Andreas Hindborg <[email protected]>
Available since v7.0-rc1. LGTM,
Quoted 4 lines · Andreas Hindborg
Replace
pr_warn!and the accompanying TODO withpr_warn_once!, now that the macro is available.Signed-off-by Andreas Hindborg <[email protected]>
Quoted 3 lines
--- rust/kernel/module_param.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 27 lines · Andreas Hindborg
Replace
pr_warn!and the accompanying TODO withpr_warn_once!, now that the macro is available.Signed-off-by Andreas Hindborg <[email protected]>--- rust/kernel/module_param.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)rust/kernel/module_param.rs +1
-3@@ -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:
254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260427-params-pr-once-481c03df3e2a
Quoted 3 lines
Best regards,
Signature · 1 line
Andreas Hindborg <[email protected]>
LGTM.
The rust macro was available since v6.19-rc6-60-g46c40f938f5f.
Signature · 1 line
Aaron Tomlin
Quoted 5 lines · Andreas Hindborg
Replace
pr_warn!and the accompanying TODO withpr_warn_once!, now that the macro is available.Signed-off-by Andreas Hindborg <[email protected]>
This seems to be:
https://lore.kernel.org/rust-for-linux/[email protected]/
Another one was also sent a few moments ago:
https://lore.kernel.org/rust-for-linux/[email protected]/
Is modules going to pick the original one? Otherwise, I am happy to do so.
I guess we can assume the reviews here to apply there.
Thanks!
Cheers,
Miguel
Sami Tolvanen
maintainerHi Miguel,
Quoted 10 lines · Miguel Ojeda
Quoted 5 lines · Andreas Hindborg
Replace
pr_warn!and the accompanying TODO withpr_warn_once!, now that the macro is available.Signed-off-by Andreas Hindborg <[email protected]>This seems to be:
Quoted 7 lines
https://lore.kernel.org/rust-for-linux/[email protected]/
Another one was also sent a few moments ago:
https://lore.kernel.org/rust-for-linux/[email protected]/
Is modules going to pick the original one? Otherwise, I am happy to do so.
Yes, this is on my list for v7.2.
Sami
Quoted 4 lines · Andreas Hindborg
Replace
pr_warn!and the accompanying TODO withpr_warn_once!, now that the macro is available.
Applied to modules-next, thanks!
[1/1] rust: module_param: use pr_warn_once! for null pointer warning
commit: 8d2a562b7efe98fdea57d10caaced911fca46a3f
Best regards,
Sami
Quoted 5 lines · Sami Tolvanen
Applied to modules-next, thanks!
[1/1] rust:
module_param: usepr_warn_once!for null pointer warningcommit: 8d2a562b7efe98fdea57d10caaced911fca46a3f
Even if we pick this one, should we credit Adarsh Das?
https://lore.kernel.org/rust-for-linux/[email protected]/
Or did Andreas send it earlier than that?
Cheers,
Miguel
Sami Tolvanen
maintainerQuoted 5 lines · Miguel Ojeda
Quoted 3 lines · Sami Tolvanen
Applied to modules-next, thanks!
Quoted 8 lines
Quoted 2 lines
[1/1] rust:
module_param: usepr_warn_once!for null pointer warningcommit: 8d2a562b7efe98fdea57d10caaced911fca46a3fEven if we pick this one, should we credit Adarsh Das?
https://lore.kernel.org/rust-for-linux/[email protected]/
Or did Andreas send it earlier than that?
Ah, that series was never sent to linux-modules, so it wasn't on my list. I agree that Adarsh seems to have sent the same patch first though. Happy to credit him unless someone objects.
Sami