Commit be16aba5ce8d04b8ca0ebd5ac95d878064e44bd8
Committed by
Scott Wood
1 parent
2f665945b3
Exists in
v2017.01-smarct4x
and in
37 other branches
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 <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>
Showing 1 changed file with 1 additions and 3 deletions Side-by-side Diff
drivers/mtd/nand/nand_base.c
... | ... | @@ -308,8 +308,7 @@ |
308 | 308 | { |
309 | 309 | int i; |
310 | 310 | u16 *p = (u16 *) buf; |
311 | - len >>= 1; | |
312 | - | |
311 | + | |
313 | 312 | for (i = 0; i < len; i++) |
314 | 313 | p[i] = readw(addr); |
315 | 314 | } |
... | ... | @@ -318,7 +317,6 @@ |
318 | 317 | { |
319 | 318 | int i; |
320 | 319 | u16 *p = (u16 *) buf; |
321 | - len >>= 1; | |
322 | 320 | |
323 | 321 | for (i = 0; i < len; i++) |
324 | 322 | writew(p[i], addr); |