[PATCH v3 5/6] rust: workqueue: replace `kernel::c_str!` with C-Strings

From: Tamir Duberstein

Date: Thu Nov 13 2025 - 17:58:46 EST


From: Tamir Duberstein <tamird@xxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxx>
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Reviewed-by: Benno Lossin <lossin@xxxxxxxxxx>
Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxx>
---
rust/kernel/workqueue.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs
index 706e833e9702..6dd47095455f 100644
--- a/rust/kernel/workqueue.rs
+++ b/rust/kernel/workqueue.rs
@@ -51,7 +51,7 @@
//! fn new(value: i32) -> Result<Arc<Self>> {
//! Arc::pin_init(pin_init!(MyStruct {
//! value,
-//! work <- new_work!("MyStruct::work"),
+//! work <- new_work!(c"MyStruct::work"),
//! }), GFP_KERNEL)
//! }
//! }
@@ -98,8 +98,8 @@
//! Arc::pin_init(pin_init!(MyStruct {
//! value_1,
//! value_2,
-//! work_1 <- new_work!("MyStruct::work_1"),
-//! work_2 <- new_work!("MyStruct::work_2"),
+//! work_1 <- new_work!(c"MyStruct::work_1"),
+//! work_2 <- new_work!(c"MyStruct::work_2"),
//! }), GFP_KERNEL)
//! }
//! }
@@ -337,7 +337,7 @@ pub fn try_spawn<T: 'static + Send + FnOnce()>(
func: T,
) -> Result<(), AllocError> {
let init = pin_init!(ClosureWork {
- work <- new_work!("Queue::try_spawn"),
+ work <- new_work!(c"Queue::try_spawn"),
func: Some(func),
});


--
2.51.2