Re: [PATCH v7 6/6] rust: add parameter support to the `module!` macro

2025-02-24 Thread Daniel Almeida
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

Re: [PATCH v7 5/6] rust: str: add radix prefixed integer parsing functions

2025-02-24 Thread Daniel Almeida
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:

Re: [PATCH v7 3/6] rust: str: implement `AsRef` for `[u8]` and `BStr`

2025-02-21 Thread Daniel Almeida
> 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

Re: [PATCH v7 4/6] rust: str: implement `strip_prefix` for `BStr`

2025-02-21 Thread Daniel Almeida
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

Re: [PATCH v7 3/6] rust: str: implement `AsRef` for `[u8]` and `BStr`

2025-02-21 Thread 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

Re: [PATCH v7 2/6] rust: str: implement `Index` for `BStr`

2025-02-21 Thread Daniel Almeida
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

Re: [PATCH v7 1/6] rust: str: implement `PartialEq` for `BStr`

2025-02-21 Thread 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

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

2025-02-21 Thread 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

Re: [PATCH] media: test-drivers: Remove duplicate include of string.h

2021-03-22 Thread Daniel Almeida
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

Re: [PATCH] media:vidtv: remove duplicate include in vidtv_psi

2021-03-07 Thread Daniel Almeida
include Acked-by: Daniel Almeida

Re: [PATCH 3/3] media: vidtv: add initial debugfs interface

2021-01-27 Thread 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