The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
@ 2025-12-22 12:18 Tamir Duberstein
  2025-12-22 14:31 ` Daniel Almeida
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tamir Duberstein @ 2025-12-22 12:18 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich
  Cc: linux-fsdevel, rust-for-linux, linux-kernel, Tamir Duberstein,
	Greg Kroah-Hartman

From: Tamir Duberstein <tamird@gmail.com>

C-String literals were added in Rust 1.77. Replace instances of
`kernel::c_str!` with C-String literals where possible.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
 rust/kernel/seq_file.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rust/kernel/seq_file.rs b/rust/kernel/seq_file.rs
index 855e533813a6..518265558d66 100644
--- a/rust/kernel/seq_file.rs
+++ b/rust/kernel/seq_file.rs
@@ -4,7 +4,7 @@
 //!
 //! C header: [`include/linux/seq_file.h`](srctree/include/linux/seq_file.h)
 
-use crate::{bindings, c_str, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
+use crate::{bindings, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
 
 /// A utility for generating the contents of a seq file.
 #[repr(transparent)]
@@ -36,7 +36,7 @@ pub fn call_printf(&self, args: fmt::Arguments<'_>) {
         unsafe {
             bindings::seq_printf(
                 self.inner.get(),
-                c_str!("%pA").as_char_ptr(),
+                c"%pA".as_char_ptr(),
                 core::ptr::from_ref(&args).cast::<crate::ffi::c_void>(),
             );
         }

---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cstr-vfs-55ca2ceca0a4

Best regards,
--  
Tamir Duberstein <tamird@gmail.com>


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
  2025-12-22 12:18 [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings Tamir Duberstein
@ 2025-12-22 14:31 ` Daniel Almeida
  2026-01-04  2:29 ` Tamir Duberstein
  2026-01-29 14:32 ` Christian Brauner
  2 siblings, 0 replies; 10+ messages in thread
From: Daniel Almeida @ 2025-12-22 14:31 UTC (permalink / raw)
  To: Tamir Duberstein
  Cc: Alexander Viro, Christian Brauner, Jan Kara, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	linux-fsdevel, rust-for-linux, linux-kernel, Tamir Duberstein,
	Greg Kroah-Hartman



> On 22 Dec 2025, at 09:18, Tamir Duberstein <tamird@kernel.org> wrote:
> 
> From: Tamir Duberstein <tamird@gmail.com>
> 
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
> 
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> Reviewed-by: Benno Lossin <lossin@kernel.org>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> ---
> rust/kernel/seq_file.rs | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/rust/kernel/seq_file.rs b/rust/kernel/seq_file.rs
> index 855e533813a6..518265558d66 100644
> --- a/rust/kernel/seq_file.rs
> +++ b/rust/kernel/seq_file.rs
> @@ -4,7 +4,7 @@
> //!
> //! C header: [`include/linux/seq_file.h`](srctree/include/linux/seq_file.h)
> 
> -use crate::{bindings, c_str, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
> +use crate::{bindings, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
> 
> /// A utility for generating the contents of a seq file.
> #[repr(transparent)]
> @@ -36,7 +36,7 @@ pub fn call_printf(&self, args: fmt::Arguments<'_>) {
>         unsafe {
>             bindings::seq_printf(
>                 self.inner.get(),
> -                c_str!("%pA").as_char_ptr(),
> +                c"%pA".as_char_ptr(),
>                 core::ptr::from_ref(&args).cast::<crate::ffi::c_void>(),
>             );
>         }
> 
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251222-cstr-vfs-55ca2ceca0a4
> 
> Best regards,
> --  
> Tamir Duberstein <tamird@gmail.com>
> 
> 

Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
  2025-12-22 12:18 [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings Tamir Duberstein
  2025-12-22 14:31 ` Daniel Almeida
@ 2026-01-04  2:29 ` Tamir Duberstein
  2026-01-19 12:52   ` Tamir Duberstein
  2026-01-29 14:32 ` Christian Brauner
  2 siblings, 1 reply; 10+ messages in thread
From: Tamir Duberstein @ 2026-01-04  2:29 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich
  Cc: linux-fsdevel, rust-for-linux, linux-kernel, Greg Kroah-Hartman

On Mon, Dec 22, 2025 at 7:19 AM Tamir Duberstein <tamird@kernel.org> wrote:
>
> From: Tamir Duberstein <tamird@gmail.com>
>
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> Reviewed-by: Benno Lossin <lossin@kernel.org>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> ---
>  rust/kernel/seq_file.rs | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/rust/kernel/seq_file.rs b/rust/kernel/seq_file.rs
> index 855e533813a6..518265558d66 100644
> --- a/rust/kernel/seq_file.rs
> +++ b/rust/kernel/seq_file.rs
> @@ -4,7 +4,7 @@
>  //!
>  //! C header: [`include/linux/seq_file.h`](srctree/include/linux/seq_file.h)
>
> -use crate::{bindings, c_str, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
> +use crate::{bindings, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
>
>  /// A utility for generating the contents of a seq file.
>  #[repr(transparent)]
> @@ -36,7 +36,7 @@ pub fn call_printf(&self, args: fmt::Arguments<'_>) {
>          unsafe {
>              bindings::seq_printf(
>                  self.inner.get(),
> -                c_str!("%pA").as_char_ptr(),
> +                c"%pA".as_char_ptr(),
>                  core::ptr::from_ref(&args).cast::<crate::ffi::c_void>(),
>              );
>          }
>
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251222-cstr-vfs-55ca2ceca0a4
>
> Best regards,
> --
> Tamir Duberstein <tamird@gmail.com>
>

@Christian could you please have a look?

Cheers.
Tamir

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
  2026-01-04  2:29 ` Tamir Duberstein
@ 2026-01-19 12:52   ` Tamir Duberstein
  2026-01-19 17:59     ` Miguel Ojeda
  0 siblings, 1 reply; 10+ messages in thread
From: Tamir Duberstein @ 2026-01-19 12:52 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich
  Cc: linux-fsdevel, rust-for-linux, linux-kernel, Greg Kroah-Hartman

On Sat, Jan 3, 2026 at 9:29 PM Tamir Duberstein <tamird@gmail.com> wrote:
>
> On Mon, Dec 22, 2025 at 7:19 AM Tamir Duberstein <tamird@kernel.org> wrote:
> >
> > From: Tamir Duberstein <tamird@gmail.com>
> >
> > C-String literals were added in Rust 1.77. Replace instances of
> > `kernel::c_str!` with C-String literals where possible.
> >
> > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> > Reviewed-by: Benno Lossin <lossin@kernel.org>
> > Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> > ---
> >  rust/kernel/seq_file.rs | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/rust/kernel/seq_file.rs b/rust/kernel/seq_file.rs
> > index 855e533813a6..518265558d66 100644
> > --- a/rust/kernel/seq_file.rs
> > +++ b/rust/kernel/seq_file.rs
> > @@ -4,7 +4,7 @@
> >  //!
> >  //! C header: [`include/linux/seq_file.h`](srctree/include/linux/seq_file.h)
> >
> > -use crate::{bindings, c_str, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
> > +use crate::{bindings, fmt, str::CStrExt as _, types::NotThreadSafe, types::Opaque};
> >
> >  /// A utility for generating the contents of a seq file.
> >  #[repr(transparent)]
> > @@ -36,7 +36,7 @@ pub fn call_printf(&self, args: fmt::Arguments<'_>) {
> >          unsafe {
> >              bindings::seq_printf(
> >                  self.inner.get(),
> > -                c_str!("%pA").as_char_ptr(),
> > +                c"%pA".as_char_ptr(),
> >                  core::ptr::from_ref(&args).cast::<crate::ffi::c_void>(),
> >              );
> >          }
> >
> > ---
> > base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> > change-id: 20251222-cstr-vfs-55ca2ceca0a4
> >
> > Best regards,
> > --
> > Tamir Duberstein <tamird@gmail.com>
> >
>
> @Christian could you please have a look?
>
> Cheers.
> Tamir

Alexander or Christian: could you please take this through vfs or
would you be ok with it going through rust-next?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
  2026-01-19 12:52   ` Tamir Duberstein
@ 2026-01-19 17:59     ` Miguel Ojeda
  2026-01-27 14:13       ` Tamir Duberstein
  0 siblings, 1 reply; 10+ messages in thread
From: Miguel Ojeda @ 2026-01-19 17:59 UTC (permalink / raw)
  To: Tamir Duberstein
  Cc: Alexander Viro, Christian Brauner, Jan Kara, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	linux-fsdevel, rust-for-linux, linux-kernel, Greg Kroah-Hartman

On Mon, Jan 19, 2026 at 1:53 PM Tamir Duberstein <tamird@gmail.com> wrote:
>
> Alexander or Christian: could you please take this through vfs or
> would you be ok with it going through rust-next?

Either seems good to me, thanks!

For context, this is part of a long migration:

    https://github.com/Rust-for-Linux/linux/issues/1075
    https://lore.kernel.org/all/20250704-core-cstr-prepare-v1-0-a91524037783@gmail.com/

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
  2026-01-19 17:59     ` Miguel Ojeda
@ 2026-01-27 14:13       ` Tamir Duberstein
  0 siblings, 0 replies; 10+ messages in thread
From: Tamir Duberstein @ 2026-01-27 14:13 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Alexander Viro, Christian Brauner, Jan Kara, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	linux-fsdevel, rust-for-linux, linux-kernel, Greg Kroah-Hartman

On Mon, Jan 19, 2026 at 12:59 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Mon, Jan 19, 2026 at 1:53 PM Tamir Duberstein <tamird@gmail.com> wrote:
> >
> > Alexander or Christian: could you please take this through vfs or
> > would you be ok with it going through rust-next?
>
> Either seems good to me, thanks!
>
> For context, this is part of a long migration:
>
>     https://github.com/Rust-for-Linux/linux/issues/1075
>     https://lore.kernel.org/all/20250704-core-cstr-prepare-v1-0-a91524037783@gmail.com/
>
> Cheers,
> Miguel

Another ping here, folks! Miguel, what can we do if we do not hear
from the vfs maintainers?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
  2025-12-22 12:18 [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings Tamir Duberstein
  2025-12-22 14:31 ` Daniel Almeida
  2026-01-04  2:29 ` Tamir Duberstein
@ 2026-01-29 14:32 ` Christian Brauner
  2026-01-29 15:14   ` Tamir Duberstein
  2 siblings, 1 reply; 10+ messages in thread
From: Christian Brauner @ 2026-01-29 14:32 UTC (permalink / raw)
  To: Tamir Duberstein
  Cc: Christian Brauner, linux-fsdevel, rust-for-linux, linux-kernel,
	Tamir Duberstein, Greg Kroah-Hartman, Alexander Viro, Jan Kara,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich

On Mon, 22 Dec 2025 13:18:57 +0100, Tamir Duberstein wrote:
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
> 
> 

Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.0.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.0.misc

[1/1] rust: seq_file: replace `kernel::c_str!` with C-Strings
      https://git.kernel.org/vfs/vfs/c/40210c2b11a8

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
  2026-01-29 14:32 ` Christian Brauner
@ 2026-01-29 15:14   ` Tamir Duberstein
  2026-01-29 15:20     ` Miguel Ojeda
  0 siblings, 1 reply; 10+ messages in thread
From: Tamir Duberstein @ 2026-01-29 15:14 UTC (permalink / raw)
  To: Christian Brauner
  Cc: linux-fsdevel, rust-for-linux, linux-kernel, Greg Kroah-Hartman,
	Alexander Viro, Jan Kara, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich

On Thu, Jan 29, 2026 at 9:33 AM Christian Brauner <brauner@kernel.org> wrote:
>
> On Mon, 22 Dec 2025 13:18:57 +0100, Tamir Duberstein wrote:
> > C-String literals were added in Rust 1.77. Replace instances of
> > `kernel::c_str!` with C-String literals where possible.
> >
> >
>
> Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree.
> Patches in the vfs-7.0.misc branch should appear in linux-next soon.
>
> Please report any outstanding bugs that were missed during review in a
> new review to the original patch series allowing us to drop it.
>
> It's encouraged to provide Acked-bys and Reviewed-bys even though the
> patch has now been applied. If possible patch trailers will be updated.
>
> Note that commit hashes shown below are subject to change due to rebase,
> trailer updates or similar. If in doubt, please check the listed branch.
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
> branch: vfs-7.0.misc
>
> [1/1] rust: seq_file: replace `kernel::c_str!` with C-Strings
>       https://git.kernel.org/vfs/vfs/c/40210c2b11a8

Thanks Cristian. The commit doesn't seem to exist (with this hash or
any other, see https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/log/?h=vfs-7.0.misc).
Is this expected?

Cheers.
Tamir

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
  2026-01-29 15:14   ` Tamir Duberstein
@ 2026-01-29 15:20     ` Miguel Ojeda
  2026-01-30 18:21       ` Tamir Duberstein
  0 siblings, 1 reply; 10+ messages in thread
From: Miguel Ojeda @ 2026-01-29 15:20 UTC (permalink / raw)
  To: Tamir Duberstein
  Cc: Christian Brauner, linux-fsdevel, rust-for-linux, linux-kernel,
	Greg Kroah-Hartman, Alexander Viro, Jan Kara, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich

On Thu, Jan 29, 2026 at 4:14 PM Tamir Duberstein <tamird@kernel.org> wrote:
>
> Thanks Cristian. The commit doesn't seem to exist (with this hash or
> any other, see https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/log/?h=vfs-7.0.misc).
> Is this expected?

Christian may not have pushed the batch yet, given the dates in the repository.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings
  2026-01-29 15:20     ` Miguel Ojeda
@ 2026-01-30 18:21       ` Tamir Duberstein
  0 siblings, 0 replies; 10+ messages in thread
From: Tamir Duberstein @ 2026-01-30 18:21 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Christian Brauner, linux-fsdevel, rust-for-linux, linux-kernel,
	Greg Kroah-Hartman, Alexander Viro, Jan Kara, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich

On Thu, Jan 29, 2026 at 10:20 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Thu, Jan 29, 2026 at 4:14 PM Tamir Duberstein <tamird@kernel.org> wrote:
> >
> > Thanks Cristian. The commit doesn't seem to exist (with this hash or
> > any other, see https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/log/?h=vfs-7.0.misc).
> > Is this expected?
>
> Christian may not have pushed the batch yet, given the dates in the repository.

Indeed, and that remains true now. Unfortunately this commit wont land
in linux-next until pushed, which is making me a bit worried about
discovering last-minute breakage.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-01-30 18:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 12:18 [PATCH] rust: seq_file: replace `kernel::c_str!` with C-Strings Tamir Duberstein
2025-12-22 14:31 ` Daniel Almeida
2026-01-04  2:29 ` Tamir Duberstein
2026-01-19 12:52   ` Tamir Duberstein
2026-01-19 17:59     ` Miguel Ojeda
2026-01-27 14:13       ` Tamir Duberstein
2026-01-29 14:32 ` Christian Brauner
2026-01-29 15:14   ` Tamir Duberstein
2026-01-29 15:20     ` Miguel Ojeda
2026-01-30 18:21       ` Tamir Duberstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox