From patchwork Wed Nov 18 01:05:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 545833 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 822CF140761 for ; Wed, 18 Nov 2015 12:10:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=0njGoWkL; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyrCV-0001IA-6j; Wed, 18 Nov 2015 01:06:19 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyrCS-0001GE-Vf for linux-mtd@lists.infradead.org; Wed, 18 Nov 2015 01:06:17 +0000 Received: by pabfh17 with SMTP id fh17so26729498pab.0 for ; Tue, 17 Nov 2015 17:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=+dcAXMIieTCORWhyo91T+B9HXd2LlVjokqAkQZbOtbA=; b=0njGoWkLdg51lfisl7kuIc5WR/hLqCpnXMZrJ0hupYhEKb4bT3psl27sR1e0OYqkDs y/T2LEpylKIrkso263cqIJOa5L9i+JFwv41FV0pdwo/S2D7KGwlBVY7VqKPFB350pI07 wBcnrjuMPdG2SUWqTdRrFhCasl/RMj6prGU7n3lPrOxDgm1r1TSiWwYGSqUaR2Xf+Vkp zolZQ9kHcd7MIjaj1w2Ta7UySefZB/+4Dvyv4f86UjoQ+mBj4Yk+Nm54z1qK1a2Upp3M q/VGrrKWsy81x+fmnhvpHeukBTYtJd/ZhdPJJhq3BsmMRe1c+8KkjQOLUCN1JOPYRT/H yEgQ== X-Received: by 10.68.198.101 with SMTP id jb5mr41653457pbc.119.1447808756196; Tue, 17 Nov 2015 17:05:56 -0800 (PST) Received: from google.com ([2620:0:1000:1301:4082:83ec:3d4e:703f]) by smtp.gmail.com with ESMTPSA id we9sm193151pab.3.2015.11.17.17.05.55 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 17:05:55 -0800 (PST) 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-Disposition: inline In-Reply-To: <20151029163632.GA2175@udknight> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_170617_076856_8B8028D8 X-CRM114-Status: GOOD ( 14.75 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:229 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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