Hi Andreas, thanks for working on this, I can see that this patch took a lot
of effort.
> On 18 Feb 2025, at 10:00, Andreas Hindborg wrote:
>
> This patch includes changes required for Rust kernel modules to utilize
> module parameters. This code implements read only support for integer
> types
Hi Andreas,
> On 18 Feb 2025, at 10:00, Andreas Hindborg wrote:
>
> 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.
>
> Signed-off-by:
> On 21 Feb 2025, at 13:01, Daniel Almeida wrote:
>
>
>
>> On 18 Feb 2025, at 10:00, Andreas Hindborg wrote:
>>
>> Implement `AsRef` for `[u8]` and `BStr` so these can be used
>> interchangeably for operations on `BStr`.
>>
>> Signed-off-by
quot;)));
> +/// assert_eq!(Some(b_str!("")),
> b_str!("foobar").strip_prefix(b_str!("foobar")));
> +/// ```
This is passing.
> +pub fn strip_prefix(&self, pattern: impl AsRef) -> Option<&BStr> {
> +self.deref()
> +.strip_prefix(pattern.as_ref().deref())
> +.map(Self::from_bytes)
> +}
> }
>
> impl fmt::Display for BStr {
>
> --
> 2.47.0
>
>
Reviewed-by: Daniel Almeida
> On 18 Feb 2025, at 10:00, Andreas Hindborg wrote:
>
> Implement `AsRef` for `[u8]` and `BStr` so these can be used
> interchangeably for operations on `BStr`.
>
> Signed-off-by: Andreas Hindborg
> ---
> rust/kernel/str.rs | 12
> 1 file changed, 12 insertions(+)
>
> diff --git
BStr::from_bytes(&self.0[index])
> +}
> +}
> +
> /// Creates a new [`BStr`] from a string literal.
> ///
> /// `b_str!` converts the supplied string literal to byte string, so non-ASCII
>
> --
> 2.47.0
>
>
>
Reviewed-by: Daniel Almeida
t; +impl PartialEq for BStr {
> +fn eq(&self, other: &Self) -> bool {
> +self.deref().eq(other.deref())
> +}
> +}
> +
> /// Creates a new [`BStr`] from a string literal.
> ///
> /// `b_str!` converts the supplied string literal to byte string, so non-ASCII
>
> --
> 2.47.0
>
>
>
Reviewed-by: Daniel Almeida
y 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
I
Hi Wan, thanks for the patch!
Unfortunately, however, a similar patch has already been accepted [1]
[1]
https://patchwork.linuxtv.org/project/linux-media/patch/20210306113255.217387-1-zhang.yun...@zte.com.cn/
-- thanks
-- Daniel
include
Acked-by: Daniel Almeida
Hi Mauro! Thanks for the review.
Just one more thing though: what did you think about the way I chose to
inject the errors? (e.g. drop packet, shift bytes, create
discontinuity...etc etc)
I was just trying out a few ideas in this patch so if you also have any
input on this please let me kno
11 matches
Mail list logo