rust_binder: replace `kernel::c_str!` with C-Strings
Subsystems (2)
Tamir Duberstein
reviewerPATCH 1/1 rust_binder: replace `kernel::c_str!` with C-Strings
From: Tamir Duberstein <[email protected]>
C-String literals were added in Rust 1.77. Replace instances of kernel::c_str! with C-String literals where possible.
--- drivers/android/binder/rust_binder_main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder/rust_binder_main.rs +1 -1
@@ -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,
Signature · 1 line
Tamir Duberstein <[email protected]>
Quoted 32 lines · Tamir Duberstein
From: Tamir Duberstein <[email protected]>
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 <[email protected]>---
drivers/android/binder/rust_binder_main.rs| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/android/binder/rust_binder_main.rs +1
-2@@ -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
Quoted 5 lines
Best regards,
Signature · 1 line
Tamir Duberstein <[email protected]>
Quoted 6 lines · Tamir Duberstein
From: Tamir Duberstein <[email protected]>
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 <[email protected]>