diff options
author | Miquel Raynal <miquel.raynal@free-electrons.com> | 2018-01-19 21:11:27 +0300 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2018-01-20 12:39:02 +0300 |
commit | c1a72e2dbb4abb90bd408480d7c48ba40cb799ce (patch) | |
tree | 60ee614bf74b313dfcd00937b8e9af403e878eb0 /drivers/mtd | |
parent | c495a9275eeca0bbc9358de7200e58184e864aeb (diff) | |
download | linux-c1a72e2dbb4abb90bd408480d7c48ba40cb799ce.tar.xz |
mtd: nand: Fix build issues due to an anonymous union
GCC-4.4.4 raises errors when assigning a parameter in an anonymous
union, leading to this kind of failure:
drivers/mtd/nand/marvell_nand.c:1936:
warning: missing braces around initializer
warning: (near initialization for '(anonymous)[1].<anonymous>')
error: unknown field 'data' specified in initializer
error: unknown field 'addr' specified in initializer
Work around the situation by naming these unions.
Fixes: 8878b126df76 ("mtd: nand: add ->exec_op() implementation")
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Tested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 3ff77bef9739..66b67014508f 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2335,23 +2335,24 @@ nand_op_parser_must_split_instr(const struct nand_op_parser_pattern_elem *pat, { switch (pat->type) { case NAND_OP_ADDR_INSTR: - if (!pat->addr.maxcycles) + if (!pat->ctx.addr.maxcycles) break; if (instr->ctx.addr.naddrs - *start_offset > - pat->addr.maxcycles) { - *start_offset += pat->addr.maxcycles; + pat->ctx.addr.maxcycles) { + *start_offset += pat->ctx.addr.maxcycles; return true; } break; case NAND_OP_DATA_IN_INSTR: case NAND_OP_DATA_OUT_INSTR: - if (!pat->data.maxlen) + if (!pat->ctx.data.maxlen) break; - if (instr->ctx.data.len - *start_offset > pat->data.maxlen) { - *start_offset += pat->data.maxlen; + if (instr->ctx.data.len - *start_offset > + pat->ctx.data.maxlen) { + *start_offset += pat->ctx.data.maxlen; return true; } break; |