MLK-16330: mtd: fsl-quadspi: remove unnecessary variable
authorHan Xu <han.xu@nxp.com>
Wed, 30 Aug 2017 21:05:11 +0000 (16:05 -0500)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:22 +0000 (15:38 -0500)
Remove the unnecessary tmp array from code

Signed-off-by: Han Xu <han.xu@nxp.com>
drivers/mtd/spi-nor/fsl-quadspi.c

index dd0d817..640eb10 100644 (file)
@@ -1091,7 +1091,6 @@ static ssize_t fsl_qspi_read(struct spi_nor *nor, loff_t from,
 {
        struct fsl_qspi *q = nor->priv;
        u8 cmd = nor->read_opcode;
-       u8 tmp[8] = {0};
        int i, j;
 
        /* if necessary,ioremap buffer before AHB read, */
@@ -1131,10 +1130,9 @@ static ssize_t fsl_qspi_read(struct spi_nor *nor, loff_t from,
        if (from % 8) {
                j = 8 - (from & 0x7);
                for (i = 0; i < j; ++i) {
-                       memcpy(tmp + i, q->ahb_addr + q->chip_base_addr + from
+                       memcpy(buf + i, q->ahb_addr + q->chip_base_addr + from
                               - q->memmap_offs + i, 1);
                }
-               memcpy(buf, tmp, j);
                memcpy(buf + j, q->ahb_addr + q->chip_base_addr + from
                       - q->memmap_offs + j, len - j);
        } else {