summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2016-07-06 20:44:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-07 09:36:31 +0200
commitff06cdf26d6983ba147570d4811ba732feeebd9d (patch)
tree563e172fd415c8c232e03012d5cda152e786af33
parent3dc604d636c73c3526708140fd5d018ecc34346e (diff)
downloadbarebox-ff06cdf26d6983ba147570d4811ba732feeebd9d.tar.gz
barebox-ff06cdf26d6983ba147570d4811ba732feeebd9d.tar.xz
imx-bbu-nand-fcb: don't drop error return code
bit_to_flip might be negative if any uncorrectable bitflips occured. Use int instead of unsigned type in order to properly propagate the error. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/imx-bbu-nand-fcb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c
index 72b7b0ea6d..ce00ed4fc0 100644
--- a/common/imx-bbu-nand-fcb.c
+++ b/common/imx-bbu-nand-fcb.c
@@ -259,8 +259,8 @@ static ssize_t raw_write_page(struct mtd_info *mtd, void *buf, loff_t offset)
static int read_fcb(struct mtd_info *mtd, int num, struct fcb_block **retfcb)
{
int i;
- int bitflips = 0;
- u8 parity, np, syndrome, bit_to_flip;
+ int bitflips = 0, bit_to_flip;
+ u8 parity, np, syndrome;
u8 *fcb, *ecc;
int ret;
void *rawpage;