]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2018 16:04:52 +0000 (18:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2018 16:04:52 +0000 (18:04 +0200)
added patches:
mtd-fsl-quadspi-fix-macro-collision-problems-with-read-write.patch

queue-3.18/mtd-fsl-quadspi-fix-macro-collision-problems-with-read-write.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/mtd-fsl-quadspi-fix-macro-collision-problems-with-read-write.patch b/queue-3.18/mtd-fsl-quadspi-fix-macro-collision-problems-with-read-write.patch
new file mode 100644 (file)
index 0000000..389b82c
--- /dev/null
@@ -0,0 +1,106 @@
+From 04850c4d8613127a9b488321c0ad83bff7519311 Mon Sep 17 00:00:00 2001
+From: Han Xu <b45815@freescale.com>
+Date: Fri, 23 Oct 2015 13:18:28 -0500
+Subject: mtd: fsl-quadspi: fix macro collision problems with READ/WRITE
+
+From: Han Xu <b45815@freescale.com>
+
+commit 04850c4d8613127a9b488321c0ad83bff7519311 upstream.
+
+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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/spi-nor/fsl-quadspi.c |   20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+--- a/drivers/mtd/spi-nor/fsl-quadspi.c
++++ b/drivers/mtd/spi-nor/fsl-quadspi.c
+@@ -138,15 +138,15 @@
+ #define LUT_MODE              4
+ #define LUT_MODE2             5
+ #define LUT_MODE4             6
+-#define LUT_READ              7
+-#define LUT_WRITE             8
++#define LUT_FSL_READ          7
++#define LUT_FSL_WRITE         8
+ #define LUT_JMP_ON_CS         9
+ #define LUT_ADDR_DDR          10
+ #define LUT_MODE_DDR          11
+ #define LUT_MODE2_DDR         12
+ #define LUT_MODE4_DDR         13
+-#define LUT_READ_DDR          14
+-#define LUT_WRITE_DDR         15
++#define LUT_FSL_READ_DDR              14
++#define LUT_FSL_WRITE_DDR             15
+ #define LUT_DATA_LEARN                16
+ /*
+@@ -306,7 +306,7 @@ static void fsl_qspi_init_lut(struct fsl
+       writel(LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen),
+                       base + QUADSPI_LUT(lut_base));
+-      writel(LUT0(DUMMY, PAD1, dummy) | LUT1(READ, PAD4, rxfifo),
++      writel(LUT0(DUMMY, PAD1, dummy) | LUT1(FSL_READ, PAD4, rxfifo),
+                       base + QUADSPI_LUT(lut_base + 1));
+       /* Write enable */
+@@ -327,11 +327,11 @@ static void fsl_qspi_init_lut(struct fsl
+       writel(LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen),
+                       base + QUADSPI_LUT(lut_base));
+-      writel(LUT0(WRITE, PAD1, 0), base + QUADSPI_LUT(lut_base + 1));
++      writel(LUT0(FSL_WRITE, PAD1, 0), base + QUADSPI_LUT(lut_base + 1));
+       /* Read Status */
+       lut_base = SEQID_RDSR * 4;
+-      writel(LUT0(CMD, PAD1, SPINOR_OP_RDSR) | LUT1(READ, PAD1, 0x1),
++      writel(LUT0(CMD, PAD1, SPINOR_OP_RDSR) | LUT1(FSL_READ, PAD1, 0x1),
+                       base + QUADSPI_LUT(lut_base));
+       /* Erase a sector */
+@@ -356,17 +356,17 @@ static void fsl_qspi_init_lut(struct fsl
+       /* READ ID */
+       lut_base = SEQID_RDID * 4;
+-      writel(LUT0(CMD, PAD1, SPINOR_OP_RDID) | LUT1(READ, PAD1, 0x8),
++      writel(LUT0(CMD, PAD1, SPINOR_OP_RDID) | LUT1(FSL_READ, PAD1, 0x8),
+                       base + QUADSPI_LUT(lut_base));
+       /* Write Register */
+       lut_base = SEQID_WRSR * 4;
+-      writel(LUT0(CMD, PAD1, SPINOR_OP_WRSR) | LUT1(WRITE, PAD1, 0x2),
++      writel(LUT0(CMD, PAD1, SPINOR_OP_WRSR) | LUT1(FSL_WRITE, PAD1, 0x2),
+                       base + QUADSPI_LUT(lut_base));
+       /* Read Configuration Register */
+       lut_base = SEQID_RDCR * 4;
+-      writel(LUT0(CMD, PAD1, SPINOR_OP_RDCR) | LUT1(READ, PAD1, 0x1),
++      writel(LUT0(CMD, PAD1, SPINOR_OP_RDCR) | LUT1(FSL_READ, PAD1, 0x1),
+                       base + QUADSPI_LUT(lut_base));
+       /* Write disable */
index 63be09d6c2dece3698ee09fd7ff8a047fc0695eb..c5c61b052feca0861a10936ce3560b276a255bff 100644 (file)
@@ -97,6 +97,7 @@ crypto-mxs-dcp-fix-wait-logic-on-chan-threads.patch
 ocfs2-fix-locking-for-res-tracking-and-dlm-tracking_list.patch
 dm-thin-metadata-fix-__udivdi3-undefined-on-32-bit.patch
 make-file-credentials-available-to-the-seqfile-interfaces.patch
+mtd-fsl-quadspi-fix-macro-collision-problems-with-read-write.patch
 proc-restrict-kernel-stack-dumps-to-root.patch
 fbdev-omapfb-fix-omapfb_memory_read-infoleak.patch
 x86-vdso-fix-asm-constraints-on-vdso-syscall-fallbacks.patch