summaryrefslogtreecommitdiff
path: root/fs/yaffs2/yaffs_ecc.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-08-14 14:41:06 +0200
committerWolfgang Denk <wd@denx.de>2008-08-14 14:41:06 +0200
commit4b0708093e15b412296328bf81325cf9b69fe512 (patch)
tree3586fc61e3fbac6553d888eb3091fb6064638cbb /fs/yaffs2/yaffs_ecc.c
parent28ac6719108e989429de2b3dfa90312ba7c4d27b (diff)
downloadu-boot-imx-4b0708093e15b412296328bf81325cf9b69fe512.zip
u-boot-imx-4b0708093e15b412296328bf81325cf9b69fe512.tar.gz
u-boot-imx-4b0708093e15b412296328bf81325cf9b69fe512.tar.bz2
Coding Style cleanup, update CHANGELOG
Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'fs/yaffs2/yaffs_ecc.c')
-rw-r--r--fs/yaffs2/yaffs_ecc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/yaffs2/yaffs_ecc.c b/fs/yaffs2/yaffs_ecc.c
index a05a6b5..1b4a05d 100644
--- a/fs/yaffs2/yaffs_ecc.c
+++ b/fs/yaffs2/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.
*
*/
@@ -231,8 +231,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 */
@@ -242,7 +242,7 @@ int yaffs_ECCCorrect(unsigned char *data, unsigned char *read_ecc,
return 1; /* Corrected the error */
}
-
+
/* Unrecoverable error */
return -1;
@@ -296,7 +296,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 */
@@ -312,7 +312,7 @@ int yaffs_ECCCorrectOther(unsigned char *data, unsigned nBytes,
if(lDelta >= nBytes)
return -1;
-
+
data[lDelta] ^= (1 << bit);
return 1; /* corrected */