Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755121AbbKRBGF (ORCPT ); Tue, 17 Nov 2015 20:06:05 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:33678 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754974AbbKRBF4 (ORCPT ); Tue, 17 Nov 2015 20:05:56 -0500 Date: Tue, 17 Nov 2015 17:05:53 -0800 From: Brian Norris To: Wang YanQing , dwmw2@infradead.org, linux-mtd@lists.infradead.org, fransmeulenbroeks@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Documentation: mtd: improve nand_ecc.txt for readability and correctness Message-ID: <20151118010553.GA140706@google.com> References: <20151029163632.GA2175@udknight> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151029163632.GA2175@udknight> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2108 Lines: 45 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 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/