Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rnull: use `kernel::fmt`

Reduce coupling to implementation details of the formatting machinery by
avoiding direct use for `core`'s formatting traits and macros.

This backslid in commit d969d504bc13 ("rnull: enable configuration via
`configfs`") and commit 34585dc649fb ("rnull: add soft-irq completion
support").

Acked-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Link: https://patch.msgid.link/20251018-cstr-core-v18-5-9378a54385f8@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Tamir Duberstein and committed by
Miguel Ojeda
5cc5d805 0dac8cf4

+5 -4
+5 -4
drivers/block/rnull/configfs.rs
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 3 3 use super::{NullBlkDevice, THIS_MODULE}; 4 - use core::fmt::{Display, Write}; 5 4 use kernel::{ 6 5 block::mq::gen_disk::{GenDisk, GenDiskBuilder}, 7 6 c_str, 8 7 configfs::{self, AttributeOperations}, 9 - configfs_attrs, new_mutex, 8 + configfs_attrs, 9 + fmt::{self, Write as _}, 10 + new_mutex, 10 11 page::PAGE_SIZE, 11 12 prelude::*, 12 13 str::{kstrtobool_bytes, CString}, ··· 100 99 } 101 100 } 102 101 103 - impl Display for IRQMode { 104 - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 102 + impl fmt::Display for IRQMode { 103 + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 105 104 match self { 106 105 Self::None => f.write_str("0")?, 107 106 Self::Soft => f.write_str("1")?,