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

Configure Feed

Select the types of activity you want to include in your feed.

rust: block: use `kernel::{fmt,prelude::fmt!}`

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

Suggested-by: Alice Ryhl <aliceryhl@google.com>
Link: https://rust-for-linux.zulipchat.com/#narrow/channel/288089-General/topic/Custom.20formatting/with/516476467
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Acked-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Tamir Duberstein and committed by
Miguel Ojeda
e0be3d34 1f96115f

+4 -5
+1 -1
drivers/block/rnull.rs
··· 51 51 .logical_block_size(4096)? 52 52 .physical_block_size(4096)? 53 53 .rotational(false) 54 - .build(format_args!("rnullb{}", 0), tagset) 54 + .build(fmt!("rnullb{}", 0), tagset) 55 55 })(); 56 56 57 57 try_pin_init!(Self {
+1 -1
rust/kernel/block/mq.rs
··· 82 82 //! Arc::pin_init(TagSet::new(1, 256, 1), flags::GFP_KERNEL)?; 83 83 //! let mut disk = gen_disk::GenDiskBuilder::new() 84 84 //! .capacity_sectors(4096) 85 - //! .build(format_args!("myblk"), tagset)?; 85 + //! .build(fmt!("myblk"), tagset)?; 86 86 //! 87 87 //! # Ok::<(), kernel::error::Error>(()) 88 88 //! ```
+1 -1
rust/kernel/block/mq/gen_disk.rs
··· 6 6 //! C header: [`include/linux/blk-mq.h`](srctree/include/linux/blk-mq.h) 7 7 8 8 use crate::block::mq::{raw_writer::RawWriter, Operations, TagSet}; 9 + use crate::fmt::{self, Write}; 9 10 use crate::{bindings, error::from_err_ptr, error::Result, sync::Arc}; 10 11 use crate::{error, static_lock_class}; 11 - use core::fmt::{self, Write}; 12 12 13 13 /// A builder for [`GenDisk`]. 14 14 ///
+1 -2
rust/kernel/block/mq/raw_writer.rs
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 3 - use core::fmt::{self, Write}; 4 - 5 3 use crate::error::Result; 4 + use crate::fmt::{self, Write}; 6 5 use crate::prelude::EINVAL; 7 6 8 7 /// A mutable reference to a byte buffer where a string can be written into.