Re: [PATCH] MTD: fix s3c2410 error correction

Jörn Engel
2007-11-06T18:16:19Z

On Tue, 6 November 2007 09:09:00 -0800, Matt Reimer wrote:
>
> ping

Ben doesn't seem to comment on this, so I will. And I must say, I don't
like the function either before or after your patch.

1. In principle this is just the bog-standard 1-bit error correction
code everyone and his dog is using.
2. The original version of this function is subtly different from
nand_correct_data(). 12 of the constants are off-by-one. But no
explanation why.
3. After your patch the bit-position constants are back to original, the
0x54 remains 0x55, half the byte-position constants are back to
original and the other half that were identical are off-by-one now.
Still no explanation why.

So my first question is not whether your patch is correct or not, but
what makes s3c2410 so different from all the other bog-standard ecc
schemes?

Side note:
The last conditional in both functions,
if ((diff0 & ~(1<<fls(diff0))) == 0)
can be replaced by is_power_of_2().

Jörn

--
Happiness isn't having what you want, it's wanting what you have.
-- unknown