Re: [PATCH v6 3/4] rust: replace `kernel::c_str!` with C-Strings
From: Tamir Duberstein
Date: Sun Feb 02 2025 - 09:19:49 EST
On Sun, Feb 2, 2025 at 8:10 AM Dirk Behme <dirk.behme@xxxxxxxxx> wrote:
>
> Hi Tamir,
>
> On 02.02.25 13:20, Tamir Duberstein wrote:
> > C-String literals were added in Rust 1.77. Replace instances of
> > `kernel::c_str!` with C-String literals where possible and rename
> > `kernel::c_str!` to `c_str_avoid_literals` to clarify its intended use.
> >
> > Closes: https://github.com/Rust-for-Linux/linux/issues/1075
> > Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxx>
> > ---
> > drivers/net/phy/ax88796b_rust.rs | 7 +++----
> > drivers/net/phy/qt2025.rs | 5 ++---
> > rust/kernel/firmware.rs | 4 ++--
> > rust/kernel/kunit.rs | 7 ++++---
> > rust/kernel/net/phy.rs | 6 ++----
> > rust/kernel/str.rs | 37 ++++++++++++++++++++++++-------------
> > rust/kernel/sync.rs | 4 ++--
> > rust/kernel/sync/lock/global.rs | 3 ++-
> > 8 files changed, 41 insertions(+), 32 deletions(-)
>
>
> Have you checked samples/rust/ [1] as well?
>
> Best regards
>
> Dirk
Hi Dirk, I had, but I was working on rust-next rather than on
torvalds/master. I'll update the other samples in v7.