Re: [PATCH v1 1/2] vsprintf: Add %pR human-readable size

From: Ilpo Järvinen

Date: Mon Aug 24 2026 - 04:32:05 EST


On Sun, 9 Aug 2026, Andy Shevchenko wrote:

> On Sat, Aug 08, 2026 at 06:45:30PM -0500, Bjorn Helgaas wrote:
> > On Sat, Aug 08, 2026 at 08:43:30PM +0300, Andy Shevchenko wrote:
> > > On Sat, Aug 08, 2026 at 12:23:07PM -0500, Bjorn Helgaas wrote:
>
> ...
>
> > > > + if (res->flags & IORESOURCE_MEM) {
> > >
> > > Besides we have resource_type() macro, why only this? I would expect
> > > IO as well as 64-bit MEM version.
> >
> > We could use resource_type() here, but would have to check other bits
> > directly (IORESOURCE_PREFETCH, IORESOURCE_MEM_64, etc) since they're
> > not included.
>
> Sure.
>
> > I considered including IO and certainly could do that. IO resources
> > are smaller and it's not as interesting, but maybe we should.
> >
> > 64-bit MEM resources are already included because they have both
> > IORESOURCE_MEM and IORESOURCE_MEM_64 set.
>
> Is it guaranteed to have MEM when MEM_64 is set?

While I suspect nothing really guarantees that (by checking if invariant
holds), I'd expect many things to do weird things if a resouce only has
MEM_64 but not MEM.

--
i.