* [U-Boot] [PATCH] mtd: nand: Fix length bug in ioread16_rep() and iowrite16_rep()
@ 2014-09-05 7:57 Stefan Roese
2014-09-05 8:06 ` Heiko Schocher
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Roese @ 2014-09-05 7:57 UTC (permalink / raw)
To: u-boot
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>
---
drivers/mtd/nand/nand_base.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 085b154..c378e2a 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -309,8 +309,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);
}
@@ -319,7 +318,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);
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH] mtd: nand: Fix length bug in ioread16_rep() and iowrite16_rep()
2014-09-05 7:57 [U-Boot] [PATCH] mtd: nand: Fix length bug in ioread16_rep() and iowrite16_rep() Stefan Roese
@ 2014-09-05 8:06 ` Heiko Schocher
2014-09-24 11:03 ` Stefan Roese
0 siblings, 1 reply; 3+ messages in thread
From: Heiko Schocher @ 2014-09-05 8:06 UTC (permalink / raw)
To: u-boot
Hello Stefan,
Am 05.09.2014 09:57, schrieb Stefan Roese:
> 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>
> ---
> drivers/mtd/nand/nand_base.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
Good catch, thanks!
Acked-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] mtd: nand: Fix length bug in ioread16_rep() and iowrite16_rep()
2014-09-05 8:06 ` Heiko Schocher
@ 2014-09-24 11:03 ` Stefan Roese
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2014-09-24 11:03 UTC (permalink / raw)
To: u-boot
Hi Scott, Hi Tom,
On 05.09.2014 10:06, Heiko Schocher wrote:
>> 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>
>> ---
>> drivers/mtd/nand/nand_base.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> Good catch, thanks!
>
> Acked-by: Heiko Schocher <hs@denx.de>
This patch is also still missing. We really should add it in this
upcoming release.
Thanks,
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-24 11:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-05 7:57 [U-Boot] [PATCH] mtd: nand: Fix length bug in ioread16_rep() and iowrite16_rep() Stefan Roese
2014-09-05 8:06 ` Heiko Schocher
2014-09-24 11:03 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox