[patch 1/1] include/linux/mtd/rawnand.h: fix build with gcc-4.4.4

akpm at linux-foundation.org akpm at linux-foundation.org
Thu Jan 18 16:30:18 PST 2018


From: Andrew Morton <akpm at linux-foundation.org>
Subject: include/linux/mtd/rawnand.h: fix build with gcc-4.4.4

gcc-4.4.4 has issues with anon union initializers.  Work aound this.

drivers/mtd/nand/marvell_nand.c:1936: warning: missing braces around initializer
drivers/mtd/nand/marvell_nand.c:1936: warning: (near initialization for '(anonymous)[1].<anonymous>')
drivers/mtd/nand/marvell_nand.c:1936: error: unknown field 'data' specified in initializer
drivers/mtd/nand/marvell_nand.c:1936: error: unknown field 'addr' specified in initializer
drivers/mtd/nand/marvell_nand.c:1936: warning: missing braces around initializer
drivers/mtd/nand/marvell_nand.c:1936: warning: (near initialization for '(anonymous)[1].<anonymous>')
drivers/mtd/nand/marvell_nand.c:1936: error: unknown field 'data' specified in initializer
drivers/mtd/nand/marvell_nand.c:1936: error: unknown field 'addr' specified in i

Fixes: 02f26ecf8c77275 ("mtd: nand: add reworked Marvell NAND controller driver")
Cc: Miquel Raynal <miquel.raynal at free-electrons.com>
Cc: Sean Nyekjaer <sean.nyekjaer at prevas.dk>
Cc: Willy Tarreau <w at 1wt.eu>
Cc: Boris Brezillon <boris.brezillon at free-electrons.com>
Cc: Richard Weinberger <richard at nod.at>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
---

 include/linux/mtd/rawnand.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN include/linux/mtd/rawnand.h~include-linux-mtd-rawnandh-fix-build-with-gcc-444 include/linux/mtd/rawnand.h
--- a/include/linux/mtd/rawnand.h~include-linux-mtd-rawnandh-fix-build-with-gcc-444
+++ a/include/linux/mtd/rawnand.h
@@ -975,21 +975,21 @@ struct nand_op_parser_pattern_elem {
 	{							\
 		.type = NAND_OP_ADDR_INSTR,			\
 		.optional = _opt,				\
-		.addr.maxcycles = _maxcycles,			\
+		{ .addr = { .maxcycles = _maxcycles }, },	\
 	}
 
 #define NAND_OP_PARSER_PAT_DATA_IN_ELEM(_opt, _maxlen)		\
 	{							\
 		.type = NAND_OP_DATA_IN_INSTR,			\
 		.optional = _opt,				\
-		.data.maxlen = _maxlen,				\
+		{ .data = { .maxlen = _maxlen, }, },		\
 	}
 
 #define NAND_OP_PARSER_PAT_DATA_OUT_ELEM(_opt, _maxlen)		\
 	{							\
 		.type = NAND_OP_DATA_OUT_INSTR,			\
 		.optional = _opt,				\
-		.data.maxlen = _maxlen,				\
+		{ .data = { .maxlen = _maxlen, }, },		\
 	}
 
 #define NAND_OP_PARSER_PAT_WAITRDY_ELEM(_opt)			\
_



More information about the linux-mtd mailing list