From: Stefan Roese Date: Fri, 5 Sep 2014 07:57:01 +0000 (+0200) Subject: mtd: nand: Fix length bug in ioread16_rep() and iowrite16_rep() X-Git-Tag: v2025.01-rc5-pxa1908~14601 X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/%7B%7B?a=commitdiff_plain;h=be16aba5ce8d04b8ca0ebd5ac95d878064e44bd8;p=u-boot.git mtd: nand: Fix length bug in ioread16_rep() and iowrite16_rep() 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 Cc: Heiko Schocher Cc: Tom Rini Cc: Scott Wood Acked-by: Heiko Schocher --- diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 7153e3ca36..0b6e7ee385 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -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);