mtd: nand: Fix length bug in ioread16_rep() and iowrite16_rep()
authorStefan Roese <sr@denx.de>
Fri, 5 Sep 2014 07:57:01 +0000 (09:57 +0200)
committerScott Wood <scottwood@freescale.com>
Thu, 25 Sep 2014 18:43:00 +0000 (13:43 -0500)
The ioread16_rep() and iowrite16_rep() implementations are U-Boot specific
and have been introduced with the Linux MTD v3.14 sync. While introducing
these functions, the length for the loop has been miscalculated. The ">> 1"
is already present in the caller. So lets remove it in the function.

Tested on omap3_ha.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Scott Wood <scottwood@freescale.com>
Acked-by: Heiko Schocher <hs@denx.de>
drivers/mtd/nand/nand_base.c

index 7153e3ca3630a2219d09dfca487cc7dcafa00a55..0b6e7ee385c8da9bc5e5ad1f08c5e274e73edd15 100644 (file)
@@ -308,8 +308,7 @@ static void ioread16_rep(void *addr, void *buf, int len)
 {
        int i;
        u16 *p = (u16 *) buf;
-       len >>= 1;
+
        for (i = 0; i < len; i++)
                p[i] = readw(addr);
 }
@@ -318,7 +317,6 @@ static void iowrite16_rep(void *addr, void *buf, int len)
 {
        int i;
         u16 *p = (u16 *) buf;
-        len >>= 1;
 
         for (i = 0; i < len; i++)
                 writew(p[i], addr);