From: Andy Shevchenko Date: Wed, 9 Nov 2022 15:56:18 +0000 (+0200) Subject: resource: Convert DEFINE_RES_NAMED() to be compound literal X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=52c4d11f1dce;p=linux.git resource: Convert DEFINE_RES_NAMED() to be compound literal Currently DEFINE_RES_NAMED() can only be used to fill the static data. In some cases it would be convenient to use it as right value in the assignment operation. But it can't be done as is, because compiler has no clue about the data layout. Converting it to be a compound literal allows the above mentioned usage. Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20221109155618.42276-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 27642ca15d932..67d3fb2133b6c 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -155,7 +155,7 @@ enum { /* helpers to define resources */ #define DEFINE_RES_NAMED(_start, _size, _name, _flags) \ - { \ +(struct resource) { \ .start = (_start), \ .end = (_start) + (_size) - 1, \ .name = (_name), \