Thread (1 message) 1 message, 1 author, 2025-02-22

Re: [PATCH v7 0/6] rust: extend `module!` macro with integer parameter support

From: Andreas Hindborg <a.hindborg@kernel.org>
Date: 2025-02-22 09:25:32
Also in: linux-kbuild, lkml, rust-for-linux

"Daniel Almeida" [off-list ref] writes:
Hi Andreas,
quoted
On 18 Feb 2025, at 10:00, Andreas Hindborg [off-list ref] wrote:

This series extends the `module!` macro with support module parameters. It
also adds some string to integer parsing functions and updates `BStr` with
a method to strip a string prefix.

This series stated out as code by Adam Bratschi-Kaye lifted from the original
`rust` branch [1].

After a bit of discussion on v3 about whether or not module parameters
is a good idea, it seems that module parameters in Rust has a place
in the kernel for now. This series is a dependency for `rnull`, the Rust
null block driver [2].
$ sudo modprobe rust_minimal test_parameter=2
[  251.384125] rust_minimal: Rust minimal sample (init)
[  251.384600] rust_minimal: Am I built-in? false
[  251.385010] rust_minimal: My parameter: 2
Tested-by: Daniel Almeida <daniel.almeida@collabora.com>

IMHO, this is slightly confusing, since the parameter is named
“test_parameter”, but you’re printing “My parameter”.
You are right, let's change that to "test_parameter: ".


Best regards,
Andreas Hindborg


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help