Re: [PATCH v2] resource: provide 0args DEFINE_RES variant for unset resource desc

From: Andy Shevchenko
Date: Sun Dec 28 2025 - 13:14:59 EST


On Sat, Dec 13, 2025 at 12:53:09PM +0100, Christian Marangi wrote:
> Provide a variant of DEFINE_RES that takes 0 arguments to initialize an
> "unset" resource descriptor.
>
> This should be used for the improper case of
>
> struct resource res = {};
>
> where DEFINE_RES() should be used.
>
> With this new helper variant, it would result in:
>
> struct resource res = DEFINE_RES();
>
> instead of having to define the full 3 arguments:
>
> struct resource res = DEFINE_RES(0, 0, IORESOURCE_UNSET);
>
> DEFINE_RES() with no args, will set the flags to IORESOURCE_UNSET
> signaling the resource descriptor is UNSET and doesn't reflect an actual
> resource currently.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

--
With Best Regards,
Andy Shevchenko