Re: [PATCH 08/29] Staging: yaffs2: yaffs_ecc: Add files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux