提交 52c4d11f 编写于 作者: A Andy Shevchenko 提交者: Greg Kroah-Hartman

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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: NRafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20221109155618.42276-2-andriy.shevchenko@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2a4e6285
...@@ -155,7 +155,7 @@ enum { ...@@ -155,7 +155,7 @@ enum {
/* helpers to define resources */ /* helpers to define resources */
#define DEFINE_RES_NAMED(_start, _size, _name, _flags) \ #define DEFINE_RES_NAMED(_start, _size, _name, _flags) \
{ \ (struct resource) { \
.start = (_start), \ .start = (_start), \
.end = (_start) + (_size) - 1, \ .end = (_start) + (_size) - 1, \
.name = (_name), \ .name = (_name), \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册