mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/7] imx-bbu-nand-fcb: don't drop error return code
Date: Wed,  6 Jul 2016 20:44:37 +0200	[thread overview]
Message-ID: <1467830680-5909-4-git-send-email-dev@lynxeye.de> (raw)
In-Reply-To: <1467830680-5909-1-git-send-email-dev@lynxeye.de>

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>
---
 common/imx-bbu-nand-fcb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c
index 72b7b0e..ce00ed4 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;
-- 
2.7.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2016-07-06 18:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 18:44 [PATCH 1/7] compiler: avoid redefining symbols when running with checker Lucas Stach
2016-07-06 18:44 ` [PATCH 2/7] USB: gadget: composite: avoid possible NULL ptr dereference Lucas Stach
2016-07-06 18:44 ` [PATCH 3/7] video: displaytimings: don't double free display timings Lucas Stach
2016-07-07  6:52   ` Sascha Hauer
2016-07-06 18:44 ` Lucas Stach [this message]
2016-07-06 18:44 ` [PATCH 5/7] imx-bbu-nand-fcb: avoid double free of dbbt_entries Lucas Stach
2016-07-06 18:44 ` [PATCH 6/7] clk: fix misleading indenting Lucas Stach
2016-07-06 18:44 ` [PATCH 7/7] blspec: use correct return type Lucas Stach
2016-07-07  7:43   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467830680-5909-4-git-send-email-dev@lynxeye.de \
    --to=dev@lynxeye.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox