Skip to content

Commit bda947d

Browse files
tamirdojeda
authored andcommitted
rust: kernel: add fmt module
`kernel::fmt` is a facade over `core::fmt` that can be used downstream, allowing future changes to the formatting machinery to be contained within the kernel crate without downstream code needing to be modified. Signed-off-by: Tamir Duberstein <tamird@gmail.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-2-a91524037783@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent f411b7e commit bda947d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

rust/kernel/fmt.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
//! Formatting utilities.
4+
//!
5+
//! This module is intended to be used in place of `core::fmt` in kernel code.
6+
7+
pub use core::fmt::{Arguments, Debug, Display, Error, Formatter, Result, Write};

rust/kernel/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ pub mod error;
7878
pub mod faux;
7979
#[cfg(CONFIG_RUST_FW_LOADER_ABSTRACTIONS)]
8080
pub mod firmware;
81+
pub mod fmt;
8182
pub mod fs;
8283
pub mod init;
8384
pub mod io;

0 commit comments

Comments
 (0)