[PATCH v2 1/1] kernel.h: Split out COUNT_ARGS() and CONCATENATE() to args.h

Andrew Morton akpm at linux-foundation.org
Fri Jul 14 11:55:42 PDT 2023


On Fri, 14 Jul 2023 17:22:37 +0300 Andy Shevchenko <andriy.shevchenko at linux.intel.com> wrote:

> kernel.h is being used as a dump for all kinds of stuff for a long time.
> The COUNT_ARGS() and CONCATENATE() macros may be used in some places
> without need of the full kernel.h dependency train with it.
> 
> Here is the attempt on cleaning it up by splitting out these macros().
> 
> While at it, include new header where it's being used and drop custom
> implementation of these macros and document how it works.

This blows up my x86_64 allmodconfig build, starting with

In file included from drivers/block/drbd/drbd_nl.c:78:
./include/linux/genl_magic_func.h:26:26: error: 'CONCAT_' declared as function returning an array
   26 | static struct nla_policy CONCAT_(GENL_MAGIC_FAMILY, _tla_nl_policy)[] = {
      |                          ^~~~~~~
./include/linux/genl_magic_func.h:26:15: error: parameter names (without types) in function declaration [-Werror]
   26 | static struct nla_policy CONCAT_(GENL_MAGIC_FAMILY, _tla_nl_policy)[] = {
      |               ^~~~~~~~~~
./include/linux/genl_magic_func.h:26:15: error: function 'CONCAT_' is initialized like a variable
./include/linux/drbd_genl.h:88:13: error: array index in non-array initializer
   88 | GENL_struct(DRBD_NLA_CFG_REPLY, 1, drbd_cfg_reply,
      |             ^~~~~~~~~~~~~~~~~~
./include/linux/genl_magic_func.h:24:10: note: in definition of macro 'GENL_struct'
   24 |         [tag_name] = { .type = NLA_NESTED },
      |          ^~~~~~~~
...



More information about the linux-arm-kernel mailing list