Re: [PATCH v2] rust: module_param: return value by copy from `value`

Petr Pavlu <[email protected]> Thu, 9 Jul 2026 13:48:29 +0200
Newsgroups org.kernel.vger.linux-modules,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On 6/1/26 12:17 PM, Andreas Hindborg wrote:
> 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 <[email protected]>
> Signed-off-by: Andreas Hindborg <[email protected]>

Reviewed-by: Petr Pavlu <[email protected]>

@Miguel, please let me know if I should take this patch on modules-next,
or if you'd prefer for it to go through the Rust tree.

-- 
Thanks,
Petr