Skip to content

Commit 5cc5d80

Browse files
tamirdojeda
authored andcommitted
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 d969d50 ("rnull: enable configuration via `configfs`") and commit 34585dc ("rnull: add soft-irq completion support"). Acked-by: Andreas Hindborg <[email protected]> Signed-off-by: Tamir Duberstein <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 0dac8cf commit 5cc5d80

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/block/rnull/configfs.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// SPDX-License-Identifier: GPL-2.0
22

33
use super::{NullBlkDevice, THIS_MODULE};
4-
use core::fmt::{Display, Write};
54
use kernel::{
65
block::mq::gen_disk::{GenDisk, GenDiskBuilder},
76
c_str,
87
configfs::{self, AttributeOperations},
9-
configfs_attrs, new_mutex,
8+
configfs_attrs,
9+
fmt::{self, Write as _},
10+
new_mutex,
1011
page::PAGE_SIZE,
1112
prelude::*,
1213
str::{kstrtobool_bytes, CString},
@@ -99,8 +100,8 @@ impl TryFrom<u8> for IRQMode {
99100
}
100101
}
101102

102-
impl Display for IRQMode {
103-
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
103+
impl fmt::Display for IRQMode {
104+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
104105
match self {
105106
Self::None => f.write_str("0")?,
106107
Self::Soft => f.write_str("1")?,

0 commit comments

Comments
 (0)