Skip to content

Commit 1c1fd37

Browse files
committed
mtd: spinand: Fix build with gcc < 7.5
__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@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202503181330.YcDXGy7F-lkp@intel.com/ Fixes: 7ce0d16 ("mtd: spinand: Add an optional frequency to read from cache macros") Cc: stable@vger.kernel.org Tested-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent b79fe18 commit 1c1fd37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/mtd/spinand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
SPI_MEM_OP_ADDR(2, addr, 1), \
6868
SPI_MEM_OP_DUMMY(ndummy, 1), \
6969
SPI_MEM_OP_DATA_IN(len, buf, 1), \
70-
__VA_OPT__(SPI_MEM_OP_MAX_FREQ(__VA_ARGS__)))
70+
SPI_MEM_OP_MAX_FREQ(__VA_ARGS__ + 0))
7171

7272
#define SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(addr, ndummy, buf, len) \
7373
SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \

0 commit comments

Comments
 (0)