Skip to contentSkip to conversation

rnull: replace `kernel::c_str!` with C-Strings

PATCH Applied Tamir Duberstein 3 participants 3 messages Dec 22, 2025

Subsystems (3)
lore
Share & tools
lore

Tamir Duberstein

author reviewer
#0 lore raw

PATCH 1/1 rnull: 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/block/rnull/configfs.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rnull/configfs.rs +1 -1
index 6713a6d92391..2f5a7da03af5 100644
@@ -25,7 +25,7 @@ pub(crate) fn subsystem() -> impl PinInit<kernel::configfs::Subsystem<Config>, E
         ],
     };
 
-    kernel::configfs::Subsystem::new(c_str!("rnull"), item_type, try_pin_init!(Config {}))
+    kernel::configfs::Subsystem::new(c"rnull", item_type, try_pin_init!(Config {}))
 }
 
 #[pin_data]

---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cstr-block-0611c0c035e3

Best regards,

Signature · 1 line
Tamir Duberstein <[email protected]>
reviewer Reviewed-by on v1 1/1
#1 lore raw
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.

---
drivers/block/rnull/configfs.rs | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rnull/configfs.rs +1 -2
index 6713a6d92391..2f5a7da03af5 100644
@@ -25,7 +25,7 @@ pub(crate) fn subsystem() -> impl PinInit<kernel::configfs::Subsystem<Config>, E
        ],
    };
 
-    kernel::configfs::Subsystem::new(c_str!("rnull"), item_type, try_pin_init!(Config {}))
+    kernel::configfs::Subsystem::new(c"rnull", item_type, try_pin_init!(Config {}))
 }
 
 #[pin_data]
 
---

base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cstr-block-0611c0c035e3

Quoted 5 lines

Best regards,

Signature · 1 line
Tamir Duberstein <[email protected]>
maintainer Applied
#2 lore raw
In reply to Tamir Duberstein
Quoted 4 lines · Tamir Duberstein

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

Applied, thanks!

[1/1] rnull: replace kernel::c_str! with C-Strings

      commit: 8818fa7010a53af03d2584a2b80772aeeeeba209

Best regards,

Signature · 1 line
Jens Axboe