Re: [PATCH 7/9] rust: pin-init: use `kernel::{fmt,prelude::fmt!}`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed Jul 9, 2025 at 11:01 PM CEST, Tamir Duberstein wrote:
> On Wed, Jul 9, 2025 at 4:18 PM Benno Lossin <lossin@xxxxxxxxxx> wrote:
>>
>> On Wed Jul 9, 2025 at 10:00 PM CEST, Tamir Duberstein wrote:
>> > Reduce coupling to implementation details of the formatting machinery by
>> > avoiding direct use for `core`'s formatting traits and macros.
>> >
>> > Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
>> > Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
>> > Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxx>
>> > ---
>> >  rust/kernel/init.rs | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> I usually prefix patches to init.rs with `rust: init`. I'll fix it up
>> when picking the patch or Miguel can do it if he takes it:
>>
>> Acked-by: Benno Lossin <lossin@xxxxxxxxxx>
>
> Actually, squinting at this patch more closely now, I think this isn't
> what you had in mind. The comment says "Dummy error that can be
> constructed outside the `kernel` crate." but the error now comes from
> the kernel crate :(

It's a re-export, so the comment still holds.

> Perhaps you could suggest a different modification that would both
> meet the original intent and allow references to core::fmt to
> disappear?

The code comes from a time when `Error::from_errno` was `pub(crate)`,
but that was changed some time ago... Now we can just remove the
`FromErrno` trait entirely from that example. Feel free to do that in
this series or as a standalone patch.

---
Cheers,
Benno





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux