Skip to contentSkip to conversation

MTD: make s3c2410's correct_data indicate an error for multi-bit read errors

PATCH In review Matt Reimer 1 participant 2 messages Oct 20, 2007 – Oct 25, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD: make s3c2410's correct_data indicate an error for multi-bit read errors

From: Matt Reimer <[email protected]>

If there were multiple bit errors in the data s3c2410_nand_correct_data() was returning 0 (no error) instead of -EBADMSG, so the upper layers (like JFFS2) would not know the data is corrupt.

---
 drivers/mtd/nand/s3c2410.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/nand/s3c2410.c +1 -1
index 077fdcc..1aa3a18 100644
@@ -397,7 +397,7 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
 	if ((diff0 & ~(1<<fls(diff0))) == 0)
 		return 1;
 
-	return 0;
+	return -EBADMSG;
 }
 
 /* ECC functions
Signature · 1 line
1.5.3.2
#1 lore raw

Anyone willing to ACK this patch?

Matt

Quoted 32 lines · Matt Reimer

From: Matt Reimer <[email protected]>

If there were multiple bit errors in the data s3c2410_nand_correct_data() was returning 0 (no error) instead of -EBADMSG, so the upper layers (like JFFS2) would not know the data is corrupt.

---
 drivers/mtd/nand/s3c2410.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/nand/s3c2410.c +1 -2
index 077fdcc..1aa3a18 100644
@@ -397,7 +397,7 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
        if ((diff0 & ~(1<<fls(diff0))) == 0)
                return 1;
 
-       return 0;
+       return -EBADMSG;
 }
 
 /* ECC functions
--

1.5.3.2

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/