Re: [PATCH] rust: replace `kernel::c_str!` with C-Strings in seq_file and device

From: Gary Guo

Date: Tue Jan 20 2026 - 10:02:31 EST


On Tue Jan 20, 2026 at 2:59 PM GMT, Ryan Foster wrote:
> C-String literals were added in Rust 1.77. Replace instances of
> `kernel::c_str!` with C-String literals where possible.
>
> This patch updates seq_file and device modules to use the native
> C-string literal syntax (c"...") instead of the kernel::c_str! macro.
>
> While at it, convert imports to the kernel vertical import style.
>
> Signed-off-by: Ryan Foster <foster.ryan.r@xxxxxxxxx>

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> rust/kernel/device.rs | 19 ++++++++++++-------
> rust/kernel/seq_file.rs | 12 ++++++++++--
> 2 files changed, 22 insertions(+), 9 deletions(-)