2015-11-18 01:06:05

by Brian Norris

[permalink] [raw]
Subject: Re: [PATCH] Documentation: mtd: improve nand_ecc.txt for readability and correctness

On Fri, Oct 30, 2015 at 12:36:33AM +0800, Wang YanQing wrote:
> This patch correct some representation errors, add a little
> clarification in some places, and fix indentation problems
> for pseudo code.
>
> It also delete one more white space for one place.
>
> Signed-off-by: Wang YanQing <[email protected]>

Applied to l2-mtd.git, with the following diff squashed in.

I don't believe these particular phrases have anything to do with
endianness, although the algorithm does swap a few things differently
depending on the host CPU endianness.

diff --git a/Documentation/mtd/nand_ecc.txt b/Documentation/mtd/nand_ecc.txt
index ccb1f260828c..f8c3284bf6a7 100644
--- a/Documentation/mtd/nand_ecc.txt
+++ b/Documentation/mtd/nand_ecc.txt
@@ -273,9 +273,9 @@ byte. A quick analysis:
for the column parity we use the par variable. When extending to 32 bits
we can in the end easily calculate rp0 and rp1 from it.
(because par now consists of 4 bytes, contributing to rp1, rp0, rp1, rp0
-respectively, from MSB to LSB in little endian mode)
+respectively, from MSB to LSB)
also rp2 and rp3 can be easily retrieved from par as rp3 covers the
-first two MSBs and rp2 covers the last two LSBs in little endian mode.
+first two MSBs and rp2 covers the last two LSBs.

Note that of course now the loop is executed only 64 times (256/4).
And note that care must taken wrt byte ordering. The way bytes are
@@ -387,7 +387,7 @@ Analysis 2

The code (of course) works, and hurray: we are a little bit faster than
the linux driver code (about 15%). But wait, don't cheer too quickly.
-THere is more to be gained.
+There is more to be gained.
If we look at e.g. rp14 and rp15 we see that we either xor our data with
rp14 or with rp15. However we also have par which goes over all data.
This means there is no need to calculate rp14 as it can be calculated from