Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84257
b: refs/heads/master
c: d0bf379
h: refs/heads/master
i:
  84255: 4b172a0
v: v3
  • Loading branch information
Matt Reimer authored and David Woodhouse committed Jan 26, 2008
1 parent eb385f2 commit 79b251b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fac9f698404a5cd50b978fbdb7e54235353c215
refs/heads/master: d0bf37932ac98cc793da2164ac1a4656fbf34bbc
26 changes: 12 additions & 14 deletions trunk/drivers/mtd/nand/s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,23 +366,21 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
((diff2 ^ (diff2 >> 1)) & 0x55) == 0x55) {
/* calculate the bit position of the error */

bit = (diff2 >> 2) & 1;
bit |= (diff2 >> 3) & 2;
bit |= (diff2 >> 4) & 4;
bit = ((diff2 >> 3) & 1) |
((diff2 >> 4) & 2) |
((diff2 >> 5) & 4);

/* calculate the byte position of the error */

byte = (diff1 << 1) & 0x80;
byte |= (diff1 << 2) & 0x40;
byte |= (diff1 << 3) & 0x20;
byte |= (diff1 << 4) & 0x10;

byte |= (diff0 >> 3) & 0x08;
byte |= (diff0 >> 2) & 0x04;
byte |= (diff0 >> 1) & 0x02;
byte |= (diff0 >> 0) & 0x01;

byte |= (diff2 << 8) & 0x100;
byte = ((diff2 << 7) & 0x100) |
((diff1 << 0) & 0x80) |
((diff1 << 1) & 0x40) |
((diff1 << 2) & 0x20) |
((diff1 << 3) & 0x10) |
((diff0 >> 4) & 0x08) |
((diff0 >> 3) & 0x04) |
((diff0 >> 2) & 0x02) |
((diff0 >> 1) & 0x01);

dev_dbg(info->device, "correcting error bit %d, byte %d\n",
bit, byte);
Expand Down

0 comments on commit 79b251b

Please sign in to comment.