diff options
author | wookey <wookey> | 2007-12-13 15:35:17 +0000 |
---|---|---|
committer | wookey <wookey> | 2007-12-13 15:35:17 +0000 |
commit | a4d9ea92251deb3c1389e3e3443faf4341f817db (patch) | |
tree | 42b781a6d476469bdffb171d314474d6022fd361 /yaffs_ecc.c | |
parent | 443554816b244a3ca95741ef3380d3b045ee250c (diff) |
Cleanup patch - Remove all trailing whitespace and fix a few typos.
Diffstat (limited to 'yaffs_ecc.c')
-rw-r--r-- | yaffs_ecc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/yaffs_ecc.c b/yaffs_ecc.c index be860d0..9f5973a 100644 --- a/yaffs_ecc.c +++ b/yaffs_ecc.c @@ -14,9 +14,9 @@ /* * This code implements the ECC algorithm used in SmartMedia. * - * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes. + * 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 + * 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. * */ @@ -29,7 +29,7 @@ */ const char *yaffs_ecc_c_version = - "$Id: yaffs_ecc.c,v 1.9 2007-02-14 01:09:06 wookey Exp $"; + "$Id: yaffs_ecc.c,v 1.10 2007-12-13 15:35:17 wookey Exp $"; #include "yportenv.h" @@ -228,8 +228,8 @@ int yaffs_ECCCorrect(unsigned char *data, unsigned char *read_ecc, return 1; /* Corrected the error */ } - if ((yaffs_CountBits(d0) + - yaffs_CountBits(d1) + + if ((yaffs_CountBits(d0) + + yaffs_CountBits(d1) + yaffs_CountBits(d2)) == 1) { /* Reccoverable error in ecc */ @@ -239,7 +239,7 @@ int yaffs_ECCCorrect(unsigned char *data, unsigned char *read_ecc, return 1; /* Corrected the error */ } - + /* Unrecoverable error */ return -1; @@ -293,7 +293,7 @@ int yaffs_ECCCorrectOther(unsigned char *data, unsigned nBytes, if ((cDelta | lDelta | lDeltaPrime) == 0) return 0; /* no error */ - if (lDelta == ~lDeltaPrime && + if (lDelta == ~lDeltaPrime && (((cDelta ^ (cDelta >> 1)) & 0x15) == 0x15)) { /* Single bit (recoverable) error in data */ @@ -309,7 +309,7 @@ int yaffs_ECCCorrectOther(unsigned char *data, unsigned nBytes, if(lDelta >= nBytes) return -1; - + data[lDelta] ^= (1 << bit); return 1; /* corrected */ |