public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rust_binder: replace `kernel::c_str!` with C-Strings
@ 2025-12-22 12:22 Tamir Duberstein
  2025-12-22 14:26 ` Daniel Almeida
  2025-12-26 11:57 ` Alice Ryhl
  0 siblings, 2 replies; 3+ messages in thread
From: Tamir Duberstein @ 2025-12-22 12:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Christian Brauner, Carlos Llamas, Alice Ryhl, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Trevor Gross, Danilo Krummrich
  Cc: linux-kernel, rust-for-linux, Tamir Duberstein

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.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
 drivers/android/binder/rust_binder_main.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder/rust_binder_main.rs b/drivers/android/binder/rust_binder_main.rs
index c79a9e742240..519bc2fb310d 100644
--- a/drivers/android/binder/rust_binder_main.rs
+++ b/drivers/android/binder/rust_binder_main.rs
@@ -288,7 +288,7 @@ fn init(_module: &'static kernel::ThisModule) -> Result<Self> {
 
         pr_warn!("Loaded Rust Binder.");
 
-        BINDER_SHRINKER.register(kernel::c_str!("android-binder"))?;
+        BINDER_SHRINKER.register(c"android-binder")?;
 
         // SAFETY: The module is being loaded, so we can initialize binderfs.
         unsafe { kernel::error::to_result(binderfs::init_rust_binderfs())? };

---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cstr-staging-e96cbee7d73e

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


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

* Re: [PATCH] rust_binder: replace `kernel::c_str!` with C-Strings
  2025-12-22 12:22 [PATCH] rust_binder: replace `kernel::c_str!` with C-Strings Tamir Duberstein
@ 2025-12-22 14:26 ` Daniel Almeida
  2025-12-26 11:57 ` Alice Ryhl
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Almeida @ 2025-12-22 14:26 UTC (permalink / raw)
  To: Tamir Duberstein
  Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Christian Brauner, Carlos Llamas, Alice Ryhl, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Trevor Gross, Danilo Krummrich, linux-kernel,
	rust-for-linux, Tamir Duberstein



> On 22 Dec 2025, at 09:22, 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.
> 
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> ---
> drivers/android/binder/rust_binder_main.rs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/android/binder/rust_binder_main.rs b/drivers/android/binder/rust_binder_main.rs
> index c79a9e742240..519bc2fb310d 100644
> --- a/drivers/android/binder/rust_binder_main.rs
> +++ b/drivers/android/binder/rust_binder_main.rs
> @@ -288,7 +288,7 @@ fn init(_module: &'static kernel::ThisModule) -> Result<Self> {
> 
>         pr_warn!("Loaded Rust Binder.");
> 
> -        BINDER_SHRINKER.register(kernel::c_str!("android-binder"))?;
> +        BINDER_SHRINKER.register(c"android-binder")?;
> 
>         // SAFETY: The module is being loaded, so we can initialize binderfs.
>         unsafe { kernel::error::to_result(binderfs::init_rust_binderfs())? };
> 
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251222-cstr-staging-e96cbee7d73e
> 
> Best regards,
> --  
> Tamir Duberstein <tamird@gmail.com>
> 
> 

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

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

* Re: [PATCH] rust_binder: replace `kernel::c_str!` with C-Strings
  2025-12-22 12:22 [PATCH] rust_binder: replace `kernel::c_str!` with C-Strings Tamir Duberstein
  2025-12-22 14:26 ` Daniel Almeida
@ 2025-12-26 11:57 ` Alice Ryhl
  1 sibling, 0 replies; 3+ messages in thread
From: Alice Ryhl @ 2025-12-26 11:57 UTC (permalink / raw)
  To: Tamir Duberstein
  Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Christian Brauner, Carlos Llamas, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Danilo Krummrich, linux-kernel, rust-for-linux,
	Tamir Duberstein

On Mon, Dec 22, 2025 at 01:22:17PM +0100, Tamir Duberstein 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.
> 
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>

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

end of thread, other threads:[~2025-12-26 11:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 12:22 [PATCH] rust_binder: replace `kernel::c_str!` with C-Strings Tamir Duberstein
2025-12-22 14:26 ` Daniel Almeida
2025-12-26 11:57 ` Alice Ryhl

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