aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nand/ecc.c
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2012-01-31 11:07:53 +0000
committerSpencer Oliver <spen@spen-soft.co.uk>2012-02-06 10:53:08 +0000
commitfab0dcd7e6cb8cfbf63cb41f0978902371d30205 (patch)
treea7abd6895375f767b5439020d5bed10d8ecd2d88 /src/flash/nand/ecc.c
parent1e9f8836a1af5b35b5950a24b8f19b38318df532 (diff)
build: cleanup src/flash/nand directory
Change-Id: I21bb466a35168cf04743f5baafac9fef50d01707 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/419 Tested-by: jenkins
Diffstat (limited to 'src/flash/nand/ecc.c')
-rw-r--r--src/flash/nand/ecc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/flash/nand/ecc.c b/src/flash/nand/ecc.c
index b3623d4c..f3e25513 100644
--- a/src/flash/nand/ecc.c
+++ b/src/flash/nand/ecc.c
@@ -125,7 +125,7 @@ static inline int countbits(uint32_t b)
{
int res = 0;
- for (;b; b >>= 1)
+ for (; b; b >>= 1)
res += b & 0x01;
return res;
}
@@ -134,7 +134,7 @@ static inline int countbits(uint32_t b)
* nand_correct_data - Detect and correct a 1 bit error for 256 byte block
*/
int nand_correct_data(struct nand_device *nand, u_char *dat,
- u_char *read_ecc, u_char *calc_ecc)
+ u_char *read_ecc, u_char *calc_ecc)
{
uint8_t s0, s1, s2;
@@ -151,9 +151,9 @@ int nand_correct_data(struct nand_device *nand, u_char *dat,
return 0;
/* Check for a single bit error */
- if( ((s0 ^ (s0 >> 1)) & 0x55) == 0x55 &&
- ((s1 ^ (s1 >> 1)) & 0x55) == 0x55 &&
- ((s2 ^ (s2 >> 1)) & 0x54) == 0x54) {
+ if (((s0 ^ (s0 >> 1)) & 0x55) == 0x55 &&
+ ((s1 ^ (s1 >> 1)) & 0x55) == 0x55 &&
+ ((s2 ^ (s2 >> 1)) & 0x54) == 0x54) {
uint32_t byteoffs, bitnum;
@@ -176,7 +176,7 @@ int nand_correct_data(struct nand_device *nand, u_char *dat,
return 1;
}
- if(countbits(s0 | ((uint32_t)s1 << 8) | ((uint32_t)s2 <<16)) == 1)
+ if (countbits(s0 | ((uint32_t)s1 << 8) | ((uint32_t)s2 << 16)) == 1)
return 1;
return -1;