diff options
| author | Andreas Hindborg <a.hindborg@kernel.org> | 2026-06-01 12:17:05 +0200 |
|---|---|---|
| committer | Petr Pavlu <petr.pavlu@suse.com> | 2026-07-10 14:26:46 +0200 |
| commit | d3a7d9c09185c65b3098ab56ce904f80e46b5111 (patch) | |
| tree | 800fa08ab681fdaf68071d91f69896e0b35fe9a1 /samples/rust | |
| parent | 5f99e014b960e4ec02922c5bcbe83852ad466c2b (diff) | |
| download | linux-next-d3a7d9c09185c65b3098ab56ce904f80e46b5111.tar.gz linux-next-d3a7d9c09185c65b3098ab56ce904f80e46b5111.zip | |
rust: module_param: return value by copy from `value`
For `Copy` parameter types it is more ergonomic to retrieve the
parameter value by copy than through a shared reference. Change
`ModuleParamAccess::value` to return `T` by copy when `T: Copy`,
and rename the previous reference-returning accessor to
`value_ref`. Update the in-tree caller in `rust_minimal`.
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Diffstat (limited to 'samples/rust')
| -rw-r--r-- | samples/rust/rust_minimal.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/rust/rust_minimal.rs b/samples/rust/rust_minimal.rs index 8eb9583571d7..60d03df6cd80 100644 --- a/samples/rust/rust_minimal.rs +++ b/samples/rust/rust_minimal.rs @@ -28,7 +28,7 @@ impl kernel::Module for RustMinimal { pr_info!("Am I built-in? {}\n", !cfg!(MODULE)); pr_info!( "test_parameter: {}\n", - *module_parameters::test_parameter.value() + module_parameters::test_parameter.value() ); let mut numbers = KVec::new(); |
