Re: [PATCH] mtd: spinand: Fix build with gcc < 7.5
From: Jean Delvare
Date: Thu Apr 03 2025 - 06:53:25 EST
On Tue, 1 Apr 2025 15:36:37 +0200, Miquel Raynal wrote:
> __VA_OPT__ is a macro that is useful when some arguments can be present
> or not to entirely skip some part of a definition. Unfortunately, it
> is a too recent addition that some of the still supported old GCC
> versions do not know about, and is anyway not part of C11 that is the
> version used in the kernel.
>
> Find a trick to remove this macro, typically '__VA_ARGS__ + 0' is a
> workaround used in netlink.h which works very well here, as we either
> expect:
> - 0
> - A positive value
> - No value, which means the field should be 0.
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202503181330.YcDXGy7F-lkp@xxxxxxxxx/
> Fixes: 7ce0d16d5802 ("mtd: spinand: Add an optional frequency to read from cache macros")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Tested-by: Jean Delvare <jdelvare@xxxxxxx>
Thanks Miquel!
--
Jean Delvare
SUSE L3 Support