Thread (31 messages) 31 messages, 6 authors, 6h ago

Re: [PATCH RFC 01/11] rust: print: use CStr for __LOG_PREFIX

flat view

From: "Gary Guo" <gary@garyguo.net>
Date: 2026-10-11 13:01:49
Also in: driver-core, linux-kselftest, lkml, rust-for-linux

On Sun Oct 11, 2026 at 1:52 PM BST, Thomas Weißschuh wrote:
The users of __LOG_PREFIX require that it is 0-terminated.
Currently this requirement is only encoded in safety comments.

Switch to CStr which can guarantee this invariant through the type
system.

As __LOG_PREFIX and Module::NAME are now identical, reuse the former to
implement the latter.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
See
https://lore.kernel.org/rust-for-linux/20260728-printk-v1-2-855606634d70@garyguo.net/ (local).

Best,
Gary
quoted hunk ↗ jump to hunk
---
 rust/kernel/lib.rs          |  4 ++--
 rust/kernel/print.rs        | 11 ++++-------
 rust/macros/module.rs       |  4 ++--
 scripts/rustdoc_test_gen.rs |  4 ++--
 4 files changed, 10 insertions(+), 13 deletions(-)
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help