public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] rust: module_param: support bool parameters
@ 2026-04-11 13:02 Wenzhao Liao
  2026-04-11 13:02 ` [PATCH 1/1] " Wenzhao Liao
  2026-04-11 13:20 ` [PATCH 0/1] " Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Wenzhao Liao @ 2026-04-11 13:02 UTC (permalink / raw)
  To: mcgrof, petr.pavlu, da.gomez, samitolvanen, ojeda, linux-modules,
	rust-for-linux
  Cc: atomlin, boqun, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl,
	tmgross, dakr, linux-kernel

Sorry for the earlier noise and for our unfamiliarity with parts of the
kernel submission process, which created extra burden for maintainers.

This patch adds boolean module parameter support to the Rust `module!`
parameter path.

It implements `ModuleParam` for `bool` and wires `PARAM_OPS_BOOL` into
the Rust module parameter machinery, so Rust-side parsing reuses the
existing kernel `kstrtobool()` semantics through `kstrtobool_bytes()`
instead of introducing a separate parser. A boolean parameter is also
added to `samples/rust/rust_minimal.rs` as a small reference user and
build-time validation point.

AI assistance: Codex:GPT-5 was used to help draft the `ModuleParam for
bool` implementation, the macro type mapping, and the sample parameter
wiring. I reviewed the resulting code and changelog, tested the change,
and take responsibility for the submission.

Build-tested with:
  make -C /home/lwz/rfl-dev/worktrees/rnull-upstream-contribution \
    O=/tmp/module-param-bool-build LLVM=-15 defconfig
  make -C /home/lwz/rfl-dev/worktrees/rnull-upstream-contribution \
    O=/tmp/module-param-bool-build LLVM=-15 rustavailable
  scripts/config --file /tmp/module-param-bool-build/.config \
    -e RUST -e SAMPLES -e SAMPLES_RUST -m SAMPLE_RUST_MINIMAL
  make -C /home/lwz/rfl-dev/worktrees/rnull-upstream-contribution \
    O=/tmp/module-param-bool-build LLVM=-15 olddefconfig
  make -C /home/lwz/rfl-dev/worktrees/rnull-upstream-contribution \
    O=/tmp/module-param-bool-build LLVM=-15 vmlinux
  make -C /home/lwz/rfl-dev/worktrees/rnull-upstream-contribution \
    O=/tmp/module-param-bool-build LLVM=-15 samples/rust/rust_minimal.ko

Wenzhao Liao (1):
  rust: module_param: support bool parameters

 rust/kernel/module_param.rs  | 9 ++++++++-
 rust/macros/lib.rs           | 1 +
 rust/macros/module.rs        | 1 +
 samples/rust/rust_minimal.rs | 8 ++++++++
 4 files changed, 18 insertions(+), 1 deletion(-)

-- 
2.34.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-11 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-11 13:02 [PATCH 0/1] rust: module_param: support bool parameters Wenzhao Liao
2026-04-11 13:02 ` [PATCH 1/1] " Wenzhao Liao
2026-04-11 13:20 ` [PATCH 0/1] " Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox