Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-29 Thread Benno Lossin
On Fri May 30, 2025 at 12:21 AM CEST, Tamir Duberstein wrote: > On Wed, May 28, 2025 at 11:35 AM Benno Lossin wrote: >> On Wed May 28, 2025 at 12:36 PM CEST, Alice Ryhl wrote: >> > On Mon, May 26, 2025 at 06:29:46PM -0400, Tamir Duberstein wrote: >> >> On Mon, May 26, 2025 at 11:04 AM Benno Lossin

Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-29 Thread Tamir Duberstein
On Wed, May 28, 2025 at 11:35 AM Benno Lossin wrote: > > On Wed May 28, 2025 at 12:36 PM CEST, Alice Ryhl wrote: > > On Mon, May 26, 2025 at 06:29:46PM -0400, Tamir Duberstein wrote: > >> On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote: > >> > > >> > On Sat May 24, 2025 at 10:33 PM CEST, Tami

Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-28 Thread Benno Lossin
On Wed May 28, 2025 at 12:36 PM CEST, Alice Ryhl wrote: > On Mon, May 26, 2025 at 06:29:46PM -0400, Tamir Duberstein wrote: >> On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote: >> > >> > On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote: >> > > +macro_rules! c_str_avoid_literals { >>

Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-28 Thread Alice Ryhl
On Mon, May 26, 2025 at 06:29:46PM -0400, Tamir Duberstein wrote: > On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote: > > > > On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote: > > > +macro_rules! c_str_avoid_literals { > > > > I don't like this name, how about `concat_to_c_str` or >

Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-27 Thread Tamir Duberstein
On Mon, May 26, 2025 at 7:07 PM Benno Lossin wrote: > > On Tue May 27, 2025 at 12:29 AM CEST, Tamir Duberstein wrote: > > On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote: > >> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote: > >> > +macro_rules! c_str_avoid_literals { > >> > >> I

Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-26 Thread Benno Lossin
On Tue May 27, 2025 at 12:29 AM CEST, Tamir Duberstein wrote: > On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote: >> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote: >> > +macro_rules! c_str_avoid_literals { >> >> I don't like this name, how about `concat_to_c_str` or >> `concat_wi

Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-26 Thread Tamir Duberstein
On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote: > > On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote: > > +macro_rules! c_str_avoid_literals { > > I don't like this name, how about `concat_to_c_str` or > `concat_with_nul`? > > This macro also is useful from macros that have a norm

Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-26 Thread Benno Lossin
On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote: > -/// Creates a new [`CStr`] from a string literal. > +/// Creates a static C string wrapper at compile time. > /// > -/// The string literal should not contain any `NUL` bytes. > +/// Rust supports C string literals since Rust 1.77, a

[PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-24 Thread Tamir Duberstein
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 ---