Patchwork [v2,04/16] mtd/docg3: fix BCH registers

login
register
mail settings
Submitter Robert Jarzmik
Date Nov. 10, 2011, 8:05 a.m.
Message ID <1320912342-30147-5-git-send-email-robert.jarzmik@free.fr>
Download mbox | patch
Permalink /patch/124800/
State New
Headers show

Comments

Robert Jarzmik - Nov. 10, 2011, 8:05 a.m.
BCH registers are contiguous, not on every byte. Fix the
register definitions.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 drivers/mtd/devices/docg3.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Mike Dunn - Nov. 12, 2011, 7:40 p.m.
On 11/10/2011 12:05 AM, Robert Jarzmik wrote:
> -#define DOC_BCH_SYNDROM(idx)		(0x1048 + (idx << 1))
> +#define DOC_BCH_SYNDROM(idx)		(0x1048 + (idx << 0))


Minor nit:  why the 0, and not just (0x1048 + idx) ?

Mike
Robert Jarzmik - Nov. 13, 2011, 10:20 a.m.
Mike Dunn <mikedunn@newsguy.com> writes:

> On 11/10/2011 12:05 AM, Robert Jarzmik wrote:
>> -#define DOC_BCH_SYNDROM(idx)		(0x1048 + (idx << 1))
>> +#define DOC_BCH_SYNDROM(idx)		(0x1048 + (idx << 0))
>
>
> Minor nit:  why the 0, and not just (0x1048 + idx) ?
I'll fix that, old idea I had that address bus did not stand odd adresses, and I
couldn't convince myself the "<< 0" was right, so left it to have back quicky
"<< 1". But I was wrong :)

Cheers.

Patch

diff --git a/drivers/mtd/devices/docg3.h b/drivers/mtd/devices/docg3.h
index 0d407be..62af5aa 100644
--- a/drivers/mtd/devices/docg3.h
+++ b/drivers/mtd/devices/docg3.h
@@ -105,7 +105,7 @@ 
 #define DOC_ECCCONF1			0x1042
 #define DOC_ECCPRESET			0x1044
 #define DOC_HAMMINGPARITY		0x1046
-#define DOC_BCH_SYNDROM(idx)		(0x1048 + (idx << 1))
+#define DOC_BCH_SYNDROM(idx)		(0x1048 + (idx << 0))
 
 #define DOC_PROTECTION			0x1056
 #define DOC_DPS0_ADDRLOW		0x1060