Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit a321f3ad authored by Danilo Krummrich's avatar Danilo Krummrich Committed by Miguel Ojeda
Browse files

rust: str: add {make,to}_{upper,lower}case() to CString

Add functions to convert a CString to upper- / lowercase, either
in-place or by creating a copy of the original CString.

Naming follows the one from the Rust stdlib, where functions starting
with 'to' create a copy and functions starting with 'make' perform an
in-place conversion.

This is required by the Nova project (GSP only Rust successor of
Nouveau) to convert stringified enum values (representing different GPU
chipsets) to strings in order to generate the corresponding firmware
paths. See also [1].

Link: https://rust-for-linux.zulipchat.com/#narrow/stream/288089-General/topic/String.20manipulation.20in.20kernel.20Rust

 [1]
Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
Reviewed-by: default avatarBenno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20240223163726.12397-1-dakr@redhat.com


[ Reworded to fix typo and to make the link use the `Link:` tag. ]
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent dbef1811
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment