Re: [PATCH 1/2] rust: scatterlist: tie owned tables to the device's bound lifetime
From: Danilo Krummrich
Date: Mon Nov 16 2026 - 08:17:15 EST
On Mon Nov 16, 2026 at 1:49 PM CET, Gary Guo wrote:
> On Mon Nov 16, 2026 at 12:43 PM GMT, Danilo Krummrich wrote:
>> On Mon Nov 16, 2026 at 5:02 AM CET, Alexandre Courbot wrote:
>>>> @@ -81,7 +78,7 @@ pub(crate) fn new(
>>>> let mut level0 = CoherentBox::<'_, [u64]>::zeroed_slice(
>>>> dev,
>>>> GSP_PAGE_SIZE / size_of::<u64>(),
>>>> - GFP_KERNEL
>>>> + GFP_KERNEL,
>>>
>>> Stray hunk? Maybe we can move it to patch 2 since it reformats that part
>>> anyway.
>>
>> I noticed this before sending too, but for some odd reason rustfmt insists on
>> this with this change.
>>
>> When I noticed I was 'whatever', but now I got curious. It happens when
>>
>> level2 <- {
>> build_lvl(&data)
>> .map(|l2| SGTable::new(dev, l2, DataDirection::ToDevice, GFP_KERNEL))?
>> },
>>
>> is changed to
>>
>> level2: {
>> let l2 = build_lvl(data)?;
>> SGTable::new(dev, l2, DataDirection::ToDevice, GFP_KERNEL)?
>> },
>>
> When you remove all `<-` rustfmt starts formatting macros again because it sees
> the macro invocation being a valid Rust expression.
Not exactly, that's why I picked level2. If you remove the <- from level1, but
not level2 it doesn't format, but if you do it the other way around, it does.
> I think you can also just remove the try_pin_init! here completely?
I remove all the pin-init remains in patch 2 as it propagates a bit, keeping
this one purely mechanical.