Commit 5cc5d805 authored by Tamir Duberstein's avatar Tamir Duberstein Committed by Miguel Ojeda
Browse files

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 d969d504 ("rnull: enable configuration via
`configfs`") and commit 34585dc6 ("rnull: add soft-irq completion
support").

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


Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 0dac8cf4
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0

use super::{NullBlkDevice, THIS_MODULE};
use core::fmt::{Display, Write};
use kernel::{
    block::mq::gen_disk::{GenDisk, GenDiskBuilder},
    c_str,
    configfs::{self, AttributeOperations},
    configfs_attrs, new_mutex,
    configfs_attrs,
    fmt::{self, Write as _},
    new_mutex,
    page::PAGE_SIZE,
    prelude::*,
    str::{kstrtobool_bytes, CString},
@@ -99,8 +100,8 @@ fn try_from(value: u8) -> Result<Self> {
    }
}

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