[PATCH 0/2] rust: i2c: replace `kernel::c_str!` with C-Strings

Tamir Duberstein posted 2 patches 1 month, 2 weeks ago
rust/kernel/i2c.rs              | 8 ++++----
samples/rust/rust_driver_i2c.rs | 7 +++----
samples/rust/rust_i2c_client.rs | 7 +++----
3 files changed, 10 insertions(+), 12 deletions(-)
[PATCH 0/2] rust: i2c: replace `kernel::c_str!` with C-Strings
Posted by Tamir Duberstein 1 month, 2 weeks ago
C-String literals were added in Rust 1.77. Replace instances of
`kernel::c_str!` with C-String literals where possible.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
Tamir Duberstein (2):
      rust: i2c: replace `kernel::c_str!` with C-Strings
      samples: rust: i2c: replace `kernel::c_str!` with C-Strings

 rust/kernel/i2c.rs              | 8 ++++----
 samples/rust/rust_driver_i2c.rs | 7 +++----
 samples/rust/rust_i2c_client.rs | 7 +++----
 3 files changed, 10 insertions(+), 12 deletions(-)
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cstr-i2c-fce258eb7e5d

Best regards,
--  
Tamir Duberstein <tamird@gmail.com>
Re: [PATCH 0/2] rust: i2c: replace `kernel::c_str!` with C-Strings
Posted by Miguel Ojeda 2 weeks, 5 days ago
On Mon, Dec 22, 2025 at 1:14 PM Tamir Duberstein <tamird@kernel.org> wrote:
>
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>

Applied to `rust-next` -- thanks everyone!

Cheers,
Miguel
Re: [PATCH 0/2] rust: i2c: replace `kernel::c_str!` with C-Strings
Posted by Daniel Almeida 1 month, 2 weeks ago

> On 22 Dec 2025, at 09:14, Tamir Duberstein <tamird@kernel.org> wrote:
> 
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
> 
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> ---
> Tamir Duberstein (2):
>      rust: i2c: replace `kernel::c_str!` with C-Strings
>      samples: rust: i2c: replace `kernel::c_str!` with C-Strings
> 
> rust/kernel/i2c.rs              | 8 ++++----
> samples/rust/rust_driver_i2c.rs | 7 +++----
> samples/rust/rust_i2c_client.rs | 7 +++----
> 3 files changed, 10 insertions(+), 12 deletions(-)
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251222-cstr-i2c-fce258eb7e5d
> 
> Best regards,
> --  
> Tamir Duberstein <tamird@gmail.com>
> 


Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Re: [PATCH 0/2] rust: i2c: replace `kernel::c_str!` with C-Strings
Posted by Igor Korotin 1 month, 2 weeks ago
On 12/22/2025 12:14 PM, Tamir Duberstein wrote:
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
> 
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> ---
> Tamir Duberstein (2):
>        rust: i2c: replace `kernel::c_str!` with C-Strings
>        samples: rust: i2c: replace `kernel::c_str!` with C-Strings
> 
>   rust/kernel/i2c.rs              | 8 ++++----
>   samples/rust/rust_driver_i2c.rs | 7 +++----
>   samples/rust/rust_i2c_client.rs | 7 +++----
>   3 files changed, 10 insertions(+), 12 deletions(-)
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251222-cstr-i2c-fce258eb7e5d
> 
> Best regards,
> --
> Tamir Duberstein <tamird@gmail.com>
> 

Acked-by: Igor Korotin<igor.korotin.linux@gmail.com>

Since I don’t yet have a public kernel tree, I’d appreciate it if 
someone could pick this up through their tree.

Thanks
Igor
Re: [PATCH 0/2] rust: i2c: replace `kernel::c_str!` with C-Strings
Posted by Miguel Ojeda 1 month, 2 weeks ago
On Mon, Dec 22, 2025 at 7:17 PM Igor Korotin
<igor.korotin.linux@gmail.com> wrote:
>
> Acked-by: Igor Korotin<igor.korotin.linux@gmail.com>
>
> Since I don’t yet have a public kernel tree, I’d appreciate it if
> someone could pick this up through their tree.

I can do that.

Cheers,
Miguel