Re: [PATCH 1/1] rust: module_param: support bool parameters

From: Andreas Hindborg

Date: Mon Apr 27 2026 - 04:05:28 EST


Wenzhao Liao <wenzhaoliao@xxxxxxxxxx> writes:

> Add support for parsing boolean module parameters in the Rust
> module! macro.
>
> Currently, only integer types are supported by the `module_param!`
> macros. This patch implements the `ModuleParam` trait for `bool`
> by delegating the string parsing to the existing C implementation
> via `kstrtobool_bytes()`. It also wires up `PARAM_OPS_BOOL` so that
> the Rust parameter system correctly links to the C `param_ops_bool`
> structure.
>
> For demonstration and verification, a boolean parameter is added
> to `samples/rust/rust_minimal.rs`.
>
> Assisted-by: Codex:GPT-5
> Signed-off-by: Wenzhao Liao <wenzhaoliao@xxxxxxxxxx>

Looks good to me!

Tested-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>

Best regards,
Andreas Hindborg