Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752977Ab0KATvA (ORCPT ); Mon, 1 Nov 2010 15:51:00 -0400 Received: from 124x34x33x190.ap124.ftth.ucom.ne.jp ([124.34.33.190]:54191 "EHLO master.linux-sh.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752519Ab0KATu5 (ORCPT ); Mon, 1 Nov 2010 15:50:57 -0400 Date: Tue, 2 Nov 2010 04:50:45 +0900 From: Paul Mundt To: Tracey Dent Cc: greg@kroah.com, manningc2@actrix.gen.nz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 08/29] Staging: yaffs2: yaffs_ecc: Add files Message-ID: <20101101195044.GB3176@linux-sh.org> References: <1288636877-7964-1-git-send-email-tdent48227@gmail.com> <1288636877-7964-9-git-send-email-tdent48227@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1288636877-7964-9-git-send-email-tdent48227@gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1596 Lines: 36 On Mon, Nov 01, 2010 at 02:40:56PM -0400, Tracey Dent wrote: > +/* > + * This code implements the ECC algorithm used in SmartMedia. > + * > + * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes. > + * The two unused bit are set to 1. > + * The ECC can correct single bit errors in a 256-byte page of data. Thus, two such ECC > + * blocks are used on a 512-byte NAND page. > + * > + */ > + > +/* Table generated by gen-ecc.c > + * Using a table means we do not have to calculate p1..p4 and p1'..p4' > + * for each byte of data. These are instead provided in a table in bits7..2. > + * Bit 0 of each entry indicates whether the entry has an odd or even parity, and therefore > + * this bytes influence on the line parity. > + */ > + This all looks pretty generic. Have you considered just adding gen-ecc to lib/, tying it in to hostprogs, and generating the tables during build (see the crc32 code for reference)? The rest of this would probably also be better off living in lib/ and simply being selected by the YAFFS code as necessary. > +/* Calculate the ECC for a 256-byte block of data */ > +void yaffs_ecc_cacl(const unsigned char *data, unsigned char *ecc) > +void yaffs_ecc_calc_other(const unsigned char *data, unsigned n_bytes, > + yaffs_ecc_other *ecc_other) Is there some reason for this naming inconistency? -- 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/