Thread (34 messages) 34 messages, 4 authors, 2025-05-29

Re: [PATCH v10 3/5] rust: replace `CStr` with `core::ffi::CStr`

From: Tamir Duberstein <hidden>
Date: 2025-05-27 15:31:42
Also in: dri-devel, linux-block, linux-devicetree, linux-kselftest, linux-pci, lkml, llvm, nouveau, rust-for-linux

On Mon, May 26, 2025 at 7:03 PM Benno Lossin [off-list ref] wrote:
On Tue May 27, 2025 at 12:24 AM CEST, Tamir Duberstein wrote:
quoted
On Mon, May 26, 2025 at 10:56 AM Benno Lossin [off-list ref] wrote:
quoted
On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote:
quoted
`std::ffi::CStr` was moved to `core::ffi::CStr` in Rust 1.64. Replace
`kernel::str::CStr` with `core::ffi::CStr` now that we can.
What's this supposed to mean?
It means that kernel::str::CStr was introduced before core::ffi:CStr
was available. I didn't check this before, but it is indeed true - see
https://github.com/Rust-for-Linux/linux/commit/faa3cbcca03d0dec8f8e43f1d8d5c0860d98a23f.
I see, then just write that and mention the commit.
👍
quoted
quoted
quoted
C-String literals were added in Rust 1.77. Opportunistically replace
instances of `kernel::c_str!` with C-String literals where other code
changes were already necessary; the rest will be done in a later commit.
Similarly this, the message should explain the motivation for the
change, the change itself and can include additional information.
The motivation is implied (that using standard types is preferable to
having custom ones; this is also implicit rather than explicit in
https://github.com/Rust-for-Linux/linux/issues/1075), but I can
sharpen it.
Please add this information to the commit message.
👍
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help