]> git.hungrycats.org Git - linux/commit
mtd: fsl-quadspi: fix macro collision problems with READ/WRITE
authorHan Xu <b45815@freescale.com>
Fri, 23 Oct 2015 18:18:28 +0000 (13:18 -0500)
committerSasha Levin <alexander.levin@verizon.com>
Tue, 12 Sep 2017 17:49:29 +0000 (13:49 -0400)
commit9386aae907d9ee79d54640f09d70909393e0ddeb
tree5c2a5462d37da3c9f37affe088b03685b2e1e551
parent00da0a0a5cc670084e244d080a175b23b334c726
mtd: fsl-quadspi: fix macro collision problems with READ/WRITE

[ Upstream commit 04850c4d8613127a9b488321c0ad83bff7519311 ]

Change the READ/WRITE to FSL_READ/FSL_WRITE to resolve any possible
namespace collisions with READ/WRITE macros (e.g., from <linux/fs.h>).

Problems have been seen, for example, on mips:

>> drivers/mtd/spi-nor/fsl-quadspi.c:186:5: error: 'LUT_0' undeclared (first use in this function)
      ((LUT_##ins) << INSTR0_SHIFT))
        ^
>> drivers/mtd/spi-nor/fsl-quadspi.c:188:30: note: in expansion of macro 'LUT0'

On SPARC:

drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_init_lut':
drivers/mtd/spi-nor/fsl-quadspi.c:369:1: error: 'LUT_0' undeclared (first use in this function)
drivers/mtd/spi-nor/fsl-quadspi.c:418:1: error: pasting "LUT_" and "(" does not give a valid preprocessing token
drivers/mtd/spi-nor/fsl-quadspi.c:418:2: error: implicit declaration of function 'LUT_'

And surely on others.

Fixes: d26a22d06708 ("mtd: fsl-quadspi: allow building for other ARCHes with COMPILE_TEST")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Han Xu <b45815@freescale.com>
[Brian: rewrote commit description]
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/mtd/spi-nor/fsl-quadspi.c