[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250704-core-cstr-prepare-v1-0-a91524037783@gmail.com>
Date: Fri, 04 Jul 2025 16:14:51 -0400
From: Tamir Duberstein <tamird@...il.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>, Danilo Krummrich <dakr@...nel.org>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Nishanth Menon <nm@...com>, Stephen Boyd <sboyd@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
nouveau@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
rust-for-linux@...r.kernel.org, Tamir Duberstein <tamird@...il.com>
Subject: [PATCH 0/6] Replace `kernel::str::CStr` with `core::ffi::CStr`
(cycle 1)
This series makes preparations for the replacement of our custom `CStr`
type with the analogous type available in `core`.
As this is a large migration that touches many subsystems, it will take
place in several cycles, each of which may see multiple series:
1. introduces facades in the kernel crate that downstream
code can reference. [this series]
2. migrate downstream code to kernel crate facades. (N series, divided
by subsystem).
3. replace kernel crate facades to allow `Display`ing foreign types
(such as `core::ffi::CStr`). Replace `CStr` with `core::ffi::CStr`.
4. migrate uses of `c_str!` to C-String literals. Replace references to
`kernel::str::CStr` with `kernel::ffi::CStr`. (N series, divided by
subsystem).
5. rename `c_str!` to discourage use. Remove `CStr` reexport from
`kernel/str.rs`.
Signed-off-by: Tamir Duberstein <tamird@...il.com>
---
Tamir Duberstein (6):
rust: kernel: remove `fmt!`, fix clippy::uninlined-format-args
rust: kernel: add `fmt` module
rust: use `kernel::{fmt,prelude::fmt!}`
rust: str: remove unnecessary qualification
rust: add `CStr` methods matching `core::ffi::CStr`
rust: use `core::ffi::CStr` method names
drivers/cpufreq/rcpufreq_dt.rs | 3 +-
drivers/gpu/nova-core/firmware.rs | 5 +-
rust/kernel/error.rs | 8 ++--
rust/kernel/fmt.rs | 7 +++
rust/kernel/lib.rs | 1 +
rust/kernel/opp.rs | 2 +-
rust/kernel/prelude.rs | 2 +-
rust/kernel/print.rs | 6 +--
rust/kernel/str.rs | 97 ++++++++++++++++++++++++---------------
samples/rust/rust_print_main.rs | 2 +-
10 files changed, 83 insertions(+), 50 deletions(-)
---
base-commit: 769e324b66b0d92d04f315d0c45a0f72737c7494
change-id: 20250704-core-cstr-prepare-9b9e6a7bd57e
Best regards,
--
Tamir Duberstein <tamird@...il.com>
Powered by blists - more mailing lists