mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
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`. Support for boolean parameters will initially be used by the Rust null block driver [1]. Link: https://lore.kernel.org/all/20260609-rnull-v6-19-rc5-send-v2-4-82c7404542e2@kernel.org/ [1] Assisted-by: Codex:GPT-5 Signed-off-by: Wenzhao Liao <wenzhaoliao@ruc.edu.cn> Tested-by: Andreas Hindborg <a.hindborg@kernel.org> Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org> Link: https://lore.kernel.org/linux-modules/20260411130254.3510128-1-wenzhaoliao@ruc.edu.cn/ [ppavlu: add motivation to the commit message and rebase the patch] Signed-off-by: Petr Pavlu <petr.pavlu@suse.com> |
||
|---|---|---|
| .. | ||
| hostprogs | ||
| Kconfig | ||
| Makefile | ||
| rust_configfs.rs | ||
| rust_debugfs_scoped.rs | ||
| rust_debugfs.rs | ||
| rust_dma.rs | ||
| rust_driver_auxiliary.rs | ||
| rust_driver_faux.rs | ||
| rust_driver_i2c.rs | ||
| rust_driver_pci.rs | ||
| rust_driver_platform.rs | ||
| rust_driver_usb.rs | ||
| rust_i2c_client.rs | ||
| rust_minimal.rs | ||
| rust_misc_device.rs | ||
| rust_print_events.c | ||
| rust_print_main.rs | ||
| rust_soc.rs | ||