[PATCH 05/10] mtd: peb: fix usage of uninitialized variable

Sascha Hauer s.hauer at pengutronix.de
Wed Nov 23 01:39:32 PST 2016


'read' is used in an error message but never assigned a value to. Remove
the variable.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/mtd/peb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/peb.c b/drivers/mtd/peb.c
index 639dc0e..73f90bb 100644
--- a/drivers/mtd/peb.c
+++ b/drivers/mtd/peb.c
@@ -252,7 +252,6 @@ retry:
 int mtd_peb_check_all_ff(struct mtd_info *mtd, int pnum, int offset, int len,
 			 int warn)
 {
-	size_t read;
 	int err;
 	void *buf;
 
@@ -263,8 +262,8 @@ int mtd_peb_check_all_ff(struct mtd_info *mtd, int pnum, int offset, int len,
 	err = mtd_peb_read(mtd, buf, pnum, offset, len);
 	if (err && !mtd_is_bitflip(err)) {
 		dev_err(&mtd->class_dev,
-			"error %d while reading %d bytes from PEB %d:%d, read %zd bytes\n",
-			err, len, pnum, offset, read);
+			"error %d while reading %d bytes from PEB %d:%d\n",
+			err, len, pnum, offset);
 		goto out;
 	}
 
-- 
2.10.2




More information about the barebox mailing list