Signed-off-by: Andreas Hindborg
---
rust/macros/module.rs | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/rust/macros/module.rs b/rust/macros/module.rs
index 2ddd2eeb2852..1a867a1e787e 100644
--- a/rust/macros/module.rs
+++ b/rust/macros/module.rs
@@ -179,26
Add types and traits for interfacing the C moduleparam API.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
rust/kernel/lib.rs | 1 +
rust/kernel/module_param.rs | 181
2 files changed, 182 insertions(+)
diff --git a/rust
Introduce the `SetOnce` type, a container that can only be written once.
The container uses an internal atomic to synchronize writes to the internal
value.
Reviewed-by: Alice Ryhl
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
rust/kernel/sync.rs | 2 +
rust/kernel
-Linux/linux/pull/7 [1]
Link: https://github.com/Rust-for-Linux/linux/pull/82 [2]
Link: https://github.com/Rust-for-Linux/linux/pull/87 [3]
Link: https://github.com/Rust-for-Linux/linux/issues/11 [4]
Signed-off-by: Andreas Hindborg
---
Changes in v17:
- Fix drop impl of `SetOnce` so that it works
The module subsystem people agreed to maintain rust support for modules
[1]. Thus, add entries for relevant files to modules entry in MAINTAINERS.
Link:
https://lore.kernel.org/all/0d9e596a-5316-4e00-862b-fd77552ae...@suse.com/ [1]
Acked-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
Showcase the rust module parameter support by adding a module parameter to
the `rust_minimal` sample.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
samples/rust/rust_minimal.rs | 10 ++
1 file changed, 10 insertions(+)
diff --git a/samples/rust/rust_minimal.rs b
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
rust/kernel/str.rs | 2 +
rust/kernel/str/parse_int.rs | 148 +++
2 files changed, 150 insertions(+)
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
index a927db8e079c..2b6c8b4a0ae4
Allow module parameters to be declared in the rust `module!` macro.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
rust/macros/helpers.rs | 25 +++
rust/macros/lib.rs | 31 +
rust/macros/module.rs | 178 ++---
3
"Benno Lossin" writes:
> On Wed Jul 9, 2025 at 7:52 PM CEST, Andreas Hindborg wrote:
>> Introduce the `SetOnce` type, a container that can only be written once.
>> The container uses an internal atomic to synchronize writes to the internal
>> value.
>>
>
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
rust/kernel/str.rs | 2 +
rust/kernel/str/parse_int.rs | 148 +++
2 files changed, 150 insertions(+)
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
index a927db8e079c3..2b6c8b4a0ae4b
Signed-off-by: Andreas Hindborg
---
rust/macros/module.rs | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/rust/macros/module.rs b/rust/macros/module.rs
index 2ddd2eeb28521..1a867a1e787ed 100644
--- a/rust/macros/module.rs
+++ b/rust/macros/module.rs
Introduce the `SetOnce` type, a container that can only be written once.
The container uses an internal atomic to synchronize writes to the internal
value.
Reviewed-by: Alice Ryhl
Signed-off-by: Andreas Hindborg
---
rust/kernel/sync.rs | 2 +
rust/kernel/sync/set_once.rs | 122
Showcase the rust module parameter support by adding a module parameter to
the `rust_minimal` sample.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
samples/rust/rust_minimal.rs | 10 ++
1 file changed, 10 insertions(+)
diff --git a/samples/rust/rust_minimal.rs b
The module subsystem people agreed to maintain rust support for modules
[1]. Thus, add entries for relevant files to modules entry in MAINTAINERS.
Link:
https://lore.kernel.org/all/0d9e596a-5316-4e00-862b-fd77552ae...@suse.com/ [1]
Acked-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
Add types and traits for interfacing the C moduleparam API.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
rust/kernel/lib.rs | 1 +
rust/kernel/module_param.rs | 181
2 files changed, 182 insertions(+)
diff --git a/rust
Allow module parameters to be declared in the rust `module!` macro.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
rust/macros/helpers.rs | 25 +++
rust/macros/lib.rs | 31 +
rust/macros/module.rs | 178 ++---
3
-Linux/linux/pull/7 [1]
Link: https://github.com/Rust-for-Linux/linux/pull/82 [2]
Link: https://github.com/Rust-for-Linux/linux/pull/87 [3]
Link: https://github.com/Rust-for-Linux/linux/issues/11 [4]
Signed-off-by: Andreas Hindborg
---
Changes in v16:
- Normalize imports in `set_once.rs`.
- Use
"Benno Lossin" writes:
> On Tue Jul 8, 2025 at 10:54 AM CEST, Andreas Hindborg wrote:
>> "Boqun Feng" writes:
>>
>>> On Mon, Jul 07, 2025 at 03:38:58PM +0200, Alice Ryhl wrote:
>>>> On Mon, Jul 7, 2025 at 3:32 PM Andreas Hindborg
&
"Benno Lossin" writes:
> On Tue Jul 8, 2025 at 3:06 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Mon Jul 7, 2025 at 3:29 PM CEST, Andreas Hindborg wrote:
>>>> diff --git a/rust/kernel/sync.rs b/rust/kernel/sync.rs
>>
"Miguel Ojeda" writes:
> On Mon, Jul 7, 2025 at 3:31 PM Andreas Hindborg wrote:
>>
>> Based on code by Adam Bratschi-Kaye lifted from the original `rust` branch
>> [1].
>
> I would suggest adding this sort of note to the commit messages,
> especially s
"Benno Lossin" writes:
> On Mon Jul 7, 2025 at 3:29 PM CEST, Andreas Hindborg wrote:
>> Introduce the `SetOnce` type, a container that can only be written once.
>> The container uses an internal atomic to synchronize writes to the internal
>> value.
>>
>&g
"Boqun Feng" writes:
> On Mon, Jul 07, 2025 at 03:38:58PM +0200, Alice Ryhl wrote:
>> On Mon, Jul 7, 2025 at 3:32 PM Andreas Hindborg
>> wrote:
>> >
>> > Introduce the `SetOnce` type, a container that can only be written once.
>> > The contai
"Alice Ryhl" writes:
> On Mon, Jul 7, 2025 at 3:32 PM Andreas Hindborg wrote:
>>
>> Introduce the `SetOnce` type, a container that can only be written once.
>> The container uses an internal atomic to synchronize writes to the internal
>> value.
>>
&
Andreas Hindborg writes:
> Introduce the `SetOnce` type, a container that can only be written once.
> The container uses an internal atomic to synchronize writes to the internal
> value.
>
> Signed-off-by: Andreas Hindborg
> ---
> rust/kernel/sync.rs | 2
Add types and traits for interfacing the C moduleparam API.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
rust/kernel/lib.rs | 1 +
rust/kernel/module_param.rs | 181
2 files changed, 182 insertions(+)
diff --git a/rust
Signed-off-by: Andreas Hindborg
---
rust/macros/module.rs | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/rust/macros/module.rs b/rust/macros/module.rs
index 2ddd2eeb28521..1a867a1e787ed 100644
--- a/rust/macros/module.rs
+++ b/rust/macros/module.rs
The module subsystem people agreed to maintain rust support for modules
[1]. Thus, add entries for relevant files to modules entry in MAINTAINERS.
Link:
https://lore.kernel.org/all/0d9e596a-5316-4e00-862b-fd77552ae...@suse.com/ [1]
Acked-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
-off-by: Andreas Hindborg
---
rust/kernel/str.rs | 2 +
rust/kernel/str/parse_int.rs | 148 +++
2 files changed, 150 insertions(+)
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
index a927db8e079c3..2b6c8b4a0ae4b 100644
--- a/rust/kernel
Allow module parameters to be declared in the rust `module!` macro.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
rust/macros/helpers.rs | 25 +++
rust/macros/lib.rs | 31 +
rust/macros/module.rs | 178 ++---
3
Introduce the `SetOnce` type, a container that can only be written once.
The container uses an internal atomic to synchronize writes to the internal
value.
Signed-off-by: Andreas Hindborg
---
rust/kernel/sync.rs | 2 +
rust/kernel/sync/set_once.rs | 125
/tree/bc22545f38d74473cfef3e9fd65432733435b79f
[1]
Signed-off-by: Andreas Hindborg
---
Changes in v15:
- Rebase on v6.16-rc5.
- Dedent code in module macro for better formatting.
- Rename `OnceLock` to `SetOnce`.
- Use "being initialized" rather than "being mutably accessed&quo
Showcase the rust module parameter support by adding a module parameter to
the `rust_minimal` sample.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
samples/rust/rust_minimal.rs | 10 ++
1 file changed, 10 insertions(+)
diff --git a/samples/rust/rust_minimal.rs b
"Benno Lossin" writes:
> On Fri Jul 4, 2025 at 2:29 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Wed Jul 2, 2025 at 3:18 PM CEST, Andreas Hindborg wrote:
>>>> +perm: 0, // Will not appear in
"Benno Lossin" writes:
> On Wed Jul 2, 2025 at 3:18 PM CEST, Andreas Hindborg wrote:
>> Allow module parameters to be declared in the rust `module!` macro.
>>
>> Signed-off-by: Andreas Hindborg
>
> A few nits below, with those fixed
>
> Reviewed
"Benno Lossin" writes:
> On Fri Jul 4, 2025 at 9:37 AM CEST, Andreas Hindborg wrote:
>> Andreas Hindborg writes:
>>
>>> "Danilo Krummrich" writes:
>>>
>>>> On 7/2/25 3:18 PM, Andreas Hindborg wrote:
>>>>> +/
"Benno Lossin" writes:
> On Wed Jul 2, 2025 at 3:18 PM CEST, Andreas Hindborg wrote:
>> Add types and traits for interfacing the C moduleparam API.
>>
>> Signed-off-by: Andreas Hindborg
>
> I have some nits below, but overall
>
> Reviewed-by: Be
Andreas Hindborg writes:
> "Danilo Krummrich" writes:
>
>> On 7/2/25 3:18 PM, Andreas Hindborg wrote:
>>> +/// Get a shared reference to the parameter value.
>>> +// Note: When sysfs access to parameters are enabled, we have to pass
&
"Danilo Krummrich" writes:
> On 7/2/25 3:18 PM, Andreas Hindborg wrote:
>> +/// Get a shared reference to the parameter value.
>> +// Note: When sysfs access to parameters are enabled, we have to pass
>> in a
>> +// held lock guard
"Wren Turkal" writes:
> On 7/2/25 6:18 AM, Andreas Hindborg wrote:
[...]
>> +pub struct OnceLock {
>> +init: Atomic,
>> +value: Opaque,
>> +}
>
> This type looks very much like the Once type in rust's stdlib. I am
> wondering if the
"Benno Lossin" writes:
> On Thu Jul 3, 2025 at 11:03 AM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Wed Jul 2, 2025 at 3:18 PM CEST, Andreas Hindborg wrote:
[...]
>>>> +Some(unsafe { &*self.value.
"Benno Lossin" writes:
> On Wed Jul 2, 2025 at 3:18 PM CEST, Andreas Hindborg wrote:
>> Introduce the `OnceLock` type, a container that can only be written once.
>> The container uses an internal atomic to synchronize writes to the internal
>> value.
>&g
"Alice Ryhl" writes:
> On Wed, Jul 2, 2025 at 3:54 PM Andreas Hindborg wrote:
>>
>> "Alice Ryhl" writes:
>>
>> > On Wed, Jul 2, 2025 at 3:19 PM Andreas Hindborg
>> > wrote:
>> >>
>> >> Introduce the `Onc
"Alice Ryhl" writes:
> On Wed, Jul 2, 2025 at 3:19 PM Andreas Hindborg wrote:
>>
>> Introduce the `OnceLock` type, a container that can only be written once.
>> The container uses an internal atomic to synchronize writes to the internal
>> value.
>>
&
/tree/bc22545f38d74473cfef3e9fd65432733435b79f
[1]
Signed-off-by: Andreas Hindborg
---
Note: This series now depends on the atomics series [1].
[1] https://lore.kernel.org/all/20250618164934.19817-1-boqun.f...@gmail.com
Changes in v14:
- Remove unnecessary `crate::` prefix from `module_param
-off-by: Andreas Hindborg
---
rust/kernel/str.rs | 2 +
rust/kernel/str/parse_int.rs | 148 +++
2 files changed, 150 insertions(+)
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
index a927db8e079c..2b6c8b4a0ae4 100644
--- a/rust/kernel
Introduce the `OnceLock` type, a container that can only be written once.
The container uses an internal atomic to synchronize writes to the internal
value.
Signed-off-by: Andreas Hindborg
---
rust/kernel/sync.rs | 1 +
rust/kernel/sync/once_lock.rs | 104
Allow module parameters to be declared in the rust `module!` macro.
Signed-off-by: Andreas Hindborg
---
rust/macros/helpers.rs | 25 +++
rust/macros/lib.rs | 31 +
rust/macros/module.rs | 177 ++---
3 files changed, 223 insertions
Showcase the rust module parameter support by adding a module parameter to
the `rust_minimal` sample.
Reviewed-by: Benno Lossin
Signed-off-by: Andreas Hindborg
---
samples/rust/rust_minimal.rs | 10 ++
1 file changed, 10 insertions(+)
diff --git a/samples/rust/rust_minimal.rs b
The module subsystem people agreed to maintain rust support for modules
[1]. Thus, add entries for relevant files to modules entry in MAINTAINERS.
Link:
https://lore.kernel.org/all/0d9e596a-5316-4e00-862b-fd77552ae...@suse.com/ [1]
Acked-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
Signed-off-by: Andreas Hindborg
---
rust/macros/module.rs | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/rust/macros/module.rs b/rust/macros/module.rs
index 2ddd2eeb2852..1a867a1e787e 100644
--- a/rust/macros/module.rs
+++ b/rust/macros/module.rs
@@ -179,26
Add types and traits for interfacing the C moduleparam API.
Signed-off-by: Andreas Hindborg
---
rust/kernel/lib.rs | 1 +
rust/kernel/module_param.rs | 191
2 files changed, 192 insertions(+)
diff --git a/rust/kernel/lib.rs b/rust/kernel
"Benno Lossin" writes:
> On Tue Jul 1, 2025 at 4:14 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Tue Jul 1, 2025 at 10:43 AM CEST, Andreas Hindborg wrote:
>>>> No, I am OK for now with configfs.
>>>>
>>
).
>
> Yeah we would add internal synchronization and could keep the API the
> same (except removing unsafe of course).
That is true. But I am not going to add an unsafe block to a driver just
to read module parameters. If we cannot reach agreement on merging this
with the `copy` access method, I would rather wait on a locking version.
Best regards,
Andreas Hindborg
> users, too.
Again, I do not think it is reasonable to mark this function unsafe.
> This is all assuming that we will not have many users of this added
> right away (in a cycle or two), i.e. assuming it will be easy to
> change callers later on (if only to remove the `unsafe {}`).
rnull will use this the cycle after it is merged.
Best regards,
Andreas Hindborg
"Benno Lossin" writes:
> On Tue Jul 1, 2025 at 10:43 AM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Mon Jun 30, 2025 at 3:15 PM CEST, Andreas Hindborg wrote:
>>>> "Benno Lossin" writes:
>>>>> On Mon
"Benno Lossin" writes:
> On Mon Jun 30, 2025 at 3:15 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Mon Jun 30, 2025 at 1:18 PM CEST, Andreas Hindborg wrote:
>>>> "Benno Lossin" writes:
>>>>> (no
"Benno Lossin" writes:
> On Mon Jun 30, 2025 at 1:18 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Fri Jun 27, 2025 at 9:57 AM CEST, Andreas Hindborg wrote:
>>>> Andreas Hindborg writes:
>>>>> "Benno
"Danilo Krummrich" writes:
> (Sorry for being late on this one, just a minor nit below.)
>
> On 6/12/25 3:40 PM, Andreas Hindborg wrote:
>> struct RustMinimal {
>> @@ -20,6 +26,10 @@ impl kernel::Module for RustMinimal {
>> fn init(_m
"Benno Lossin" writes:
> On Fri Jun 27, 2025 at 9:57 AM CEST, Andreas Hindborg wrote:
>> Andreas Hindborg writes:
>>> "Benno Lossin" writes:
>>>> That's good to know, then let's try to go for something simple.
>>>>
&g
Andreas Hindborg writes:
> "Benno Lossin" writes:
>
>> On Mon Jun 23, 2025 at 4:31 PM CEST, Andreas Hindborg wrote:
>>> "Benno Lossin" writes:
>>>
>>>> On Mon Jun 23, 2025 at 11:44 AM CEST, Andreas Hindborg wrote:
>>>>
"Benno Lossin" writes:
> On Mon Jun 23, 2025 at 4:31 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>
>>> On Mon Jun 23, 2025 at 11:44 AM CEST, Andreas Hindborg wrote:
>>>> "Benno Lossin" writes:
>>>>
&g
"Benno Lossin" writes:
> On Mon Jun 23, 2025 at 11:44 AM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>
>>> On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote:
>>>> "Benno Lossin" writes:
>>>&g
"Benno Lossin" writes:
> On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote:
>>>> +/// A wrapper for kernel parameters.
>>>> +///
>
"Benno Lossin" writes:
> On Fri Jun 20, 2025 at 1:29 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote:
>>>> +/// A wrapper for kernel parameters.
>>>> +///
>
Andreas Hindborg writes:
> "Benno Lossin" writes:
>
>> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote:
>>> +/// A wrapper for kernel parameters.
>>> +///
>>> +/// This type is instantiated by the [`module!`] macro when module
>
"Benno Lossin" writes:
> On Thu Jun 19, 2025 at 2:20 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote:
[...]
>>>> +crate::error::from_result(|| {
>&
"Benno Lossin" writes:
> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote:
>> +/// A wrapper for kernel parameters.
>> +///
>> +/// This type is instantiated by the [`module!`] macro when module
>> parameters are
>> +/// defined. You
"Benno Lossin" writes:
> On Thu Jun 19, 2025 at 1:12 PM CEST, Andreas Hindborg wrote:
>> I'm having a difficult time parsing. Are you suggesting that we guard
>> against implementations of `TryInto` that misbehave?
>
> Let me try a different explana
"Benno Lossin" writes:
> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote:
>> +
>> +fn emit_params(&mut self, info: &ModuleInfo) {
>> +let Some(params) = &info.params else {
>> +return;
>> +};
>
"Benno Lossin" writes:
> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote:
>> Add types and traits for interfacing the C moduleparam API.
>>
>> Signed-off-by: Andreas Hindborg
>> ---
>> rust/kernel/lib.rs |
"Benno Lossin" writes:
> On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote:
>> +pub trait ParseInt: private::FromStrRadix + TryFrom {
>> +/// Parse a string according to the description in [`Self`].
>> +fn from_str(src: &BStr) ->
When we add parameter support to the module macro, we want to be able to
pass a reference to `ModuleInfo` to a helper function. That is not possible
when we move out of the local `modinfo`. So change the function to access
the local via reference rather than value.
Signed-off-by: Andreas Hindborg
Allow module parameters to be declared in the rust `module!` macro.
Signed-off-by: Andreas Hindborg
---
rust/macros/helpers.rs | 25 +++
rust/macros/lib.rs | 31 +
rust/macros/module.rs | 175 ++---
3 files changed, 221 insertions
Add the trait `ParseInt` for parsing string representations of integers
where the string representations are optionally prefixed by a radix
specifier. Implement the trait for the primitive integer types.
Tested-by: Daniel Gomez
Reviewed-by: Greg Kroah-Hartman
Signed-off-by: Andreas Hindborg
Add types and traits for interfacing the C moduleparam API.
Signed-off-by: Andreas Hindborg
---
rust/kernel/lib.rs | 1 +
rust/kernel/module_param.rs | 201
2 files changed, 202 insertions(+)
diff --git a/rust/kernel/lib.rs b/rust/kernel
Showcase the rust module parameter support by adding a module parameter to
the `rust_minimal` sample.
Signed-off-by: Andreas Hindborg
---
samples/rust/rust_minimal.rs | 10 ++
1 file changed, 10 insertions(+)
diff --git a/samples/rust/rust_minimal.rs b/samples/rust/rust_minimal.rs
The module subsystem people agreed to maintain rust support for modules
[1]. Thus, add entries for relevant files to modules entry in MAINTAINERS.
Link:
https://lore.kernel.org/all/0d9e596a-5316-4e00-862b-fd77552ae...@suse.com/ [1]
Acked-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
/tree/bc22545f38d74473cfef3e9fd65432733435b79f
[1]
Signed-off-by: Andreas Hindborg
---
Changes in v13:
- remove absolute path for `ffi` types.
- Split patch 2 into 4 separate patches.
- Overhaul safety framework for `set_param`.
- Remove generated docs for `kernel_param_ops`.
- Move `parse_int` to
"Benno Lossin" writes:
> On Wed Jun 11, 2025 at 12:31 PM CEST, Andreas Hindborg wrote:
>> "Benno Lossin" writes:
>>> On Tue May 6, 2025 at 3:02 PM CEST, Andreas Hindborg wrote:
>>>> diff --git a/rust/macros/helpers.rs b/rust/macros/helpe
"Miguel Ojeda" writes:
> On Wed, Jun 11, 2025 at 2:24 PM Andreas Hindborg
> wrote:
>>
>> So either we need to `#[allow(missing_docs)]` or just add the line back.
>> What do you prefer?
>
> Do you mean if you remove the `concat!` too, right?
Yes, all
Andreas Hindborg writes:
> "Benno Lossin" writes:
>
>> On Tue May 6, 2025 at 3:02 PM CEST, Andreas Hindborg wrote:
>>> Add support for module parameters to the `module!` macro. Implement read
>>> only support for integer types without `sysfs` suppo
"Benno Lossin" writes:
> On Tue May 6, 2025 at 3:02 PM CEST, Andreas Hindborg wrote:
>> Add support for module parameters to the `module!` macro. Implement read
>> only support for integer types without `sysfs` support.
>>
>> Acked-by: Petr Pavlu # from mod
"Benno Lossin" writes:
> On Tue May 6, 2025 at 3:02 PM CEST, Andreas Hindborg wrote:
>> diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
>> index 878111cb77bc..174e70397305 100644
>> --- a/rust/kernel/str.rs
>> +++ b/rust/kernel/str.rs
>
The module subsystem people agreed to maintain rust support for modules
[1]. Thus, add entries for relevant files to modules entry in MAINTAINERS.
Link:
https://lore.kernel.org/all/0d9e596a-5316-4e00-862b-fd77552ae...@suse.com/ [1]
Acked-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
Add the trait `ParseInt` for parsing string representations of integers
where the string representations are optionally prefixed by a radix
specifier. Implement the trait for the primitive integer types.
Tested-by: Daniel Gomez
Reviewed-by: Greg Kroah-Hartman
Signed-off-by: Andreas Hindborg
/tree/bc22545f38d74473cfef3e9fd65432733435b79f
[1]
Signed-off-by: Andreas Hindborg
---
Changes in v12:
- Assign through pointer rather than using `core::ptr::replace`.
- Prevent a potential use-after-free during module teardown.
- Link to v11:
https://lore.kernel.org/r/20250502-module-params-v3-v11
Add support for module parameters to the `module!` macro. Implement read
only support for integer types without `sysfs` support.
Acked-by: Petr Pavlu # from modules perspective
Tested-by: Daniel Gomez
Reviewed-by: Greg Kroah-Hartman
Signed-off-by: Andreas Hindborg
---
rust/kernel/lib.rs
"Alice Ryhl" writes:
> On Mon, May 05, 2025 at 11:55:33AM +0200, Andreas Hindborg wrote:
>> "Alice Ryhl" writes:
>>
>> > On Fri, May 02, 2025 at 02:16:35PM +0200, Andreas Hindborg wrote:
>> > It would be a use-after-free to
>> > a
"Alice Ryhl" writes:
> On Fri, May 02, 2025 at 02:16:35PM +0200, Andreas Hindborg wrote:
>> Add support for module parameters to the `module!` macro. Implement read
>> only support for integer types without `sysfs` support.
>>
>> Acked-by: Petr Pavlu #
/tree/bc22545f38d74473cfef3e9fd65432733435b79f
[1]
Signed-off-by: Andreas Hindborg
---
Changes in v11:
- Apply a few nits from Miguel.
- Link to v10:
https://lore.kernel.org/r/20250501-module-params-v3-v10-0-4da485d34...@kernel.org
Changes in v10:
- Apply fixups from Miguel:
- Add integer type
The module subsystem people agreed to maintain rust support for modules
[1]. Thus, add entries for relevant files to modules entry in MAINTAINERS.
Link:
https://lore.kernel.org/all/0d9e596a-5316-4e00-862b-fd77552ae...@suse.com/ [1]
Acked-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
Add the trait `ParseInt` for parsing string representations of integers
where the string representations are optionally prefixed by a radix
specifier. Implement the trait for the primitive integer types.
Tested-by: Daniel Almeida
Reviewed-by: Daniel Almeida
Signed-off-by: Andreas Hindborg
Add support for module parameters to the `module!` macro. Implement read
only support for integer types without `sysfs` support.
Acked-by: Petr Pavlu # from modules perspective
Tested-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
---
rust/kernel/lib.rs | 1 +
rust/kernel
"Miguel Ojeda" writes:
> On Thu, May 1, 2025 at 9:55 AM Andreas Hindborg wrote:
>>
>> +pub mod parse_int {
>> +
>> +use crate::prelude::*;
>
> Spurious newline.
>
>> +use crate::str::BStr;
>> +use core::ops::Deref;
&g
Add the trait `ParseInt` for parsing string representations of integers
where the string representations are optionally prefixed by a radix
specifier. Implement the trait for the primitive integer types.
Tested-by: Daniel Almeida
Reviewed-by: Daniel Almeida
Signed-off-by: Andreas Hindborg
Add support for module parameters to the `module!` macro. Implement read
only support for integer types without `sysfs` support.
Acked-by: Petr Pavlu # from modules perspective
Tested-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
---
rust/kernel/lib.rs | 1 +
rust/kernel
The module subsystem people agreed to maintain rust support for modules
[1]. Thus, add entries for relevant files to modules entry in MAINTAINERS.
Link:
https://lore.kernel.org/all/0d9e596a-5316-4e00-862b-fd77552ae...@suse.com/ [1]
Acked-by: Daniel Gomez
Signed-off-by: Andreas Hindborg
/tree/bc22545f38d74473cfef3e9fd65432733435b79f
[1]
Signed-off-by: Andreas Hindborg
---
Changes in v10:
- Apply fixups from Miguel:
- Add integer type suffixes to `assert!` in tests.
- Fix links to docs.kernel.org.
- Applyy markdown and intra-doc links where possible.
- Change to `///` for
"Petr Pavlu" writes:
> On 3/21/25 10:17, Andreas Hindborg wrote:
>> Extend the `module!` macro with support module parameters. Also add some
>> string
>> to integer parsing functions and updates `BStr` with a method to strip a
>> string
>> prefix
"Miguel Ojeda" writes:
> On Thu, Feb 27, 2025 at 3:39 PM Andreas Hindborg
> wrote:
>>
>> +// SAFETY: We checked that `val` will fit in `Self`
>> above.
>> +let val: Self = unsafe {
>> val.try_into().unwrap
1 - 100 of 169 matches
Mail list logo