[PATCH 1/3] ubiformat: fix the subpage size hint on the error path

Sascha Hauer s.hauer at pengutronix.de
Thu Dec 10 02:07:24 PST 2015


>From mtd-utils commit:

| commit 15685fe39f1665d53d8b316c8f837f20f8700d4b
| Author: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
| Date:   Mon Sep 8 15:05:54 2014 +0300
|
|     ubiformat: fix the subpage size hint on the error path
|
|     David Binderman <dcb314 at hotmail.com> reports that the following piece of looks
|     wrong:
|
|     if (!args.subpage_size != mtd->min_io_size)
|         normsg("may be sub-page size is incorrect?");
|
|     I totally agree with him and I believe that we actually meant to have no
|     negation in fron to f 'args.subpage_size', so instead, the code should look
|     like this:
|
|     if (args.subpage_size != mtd->min_io_size)
|         normsg("may be sub-page size is incorrect?");
|
|     Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>

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

diff --git a/commands/ubiformat.c b/commands/ubiformat.c
index 8516e11..f9c50b7 100644
--- a/commands/ubiformat.c
+++ b/commands/ubiformat.c
@@ -503,9 +503,8 @@ static int format(const struct mtd_dev_info *mtd,
 				   write_size, eb);
 
 			if (errno != EIO) {
-				if (!args.subpage_size != mtd->min_io_size)
-					normsg("may be sub-page size is "
-					       "incorrect?");
+				if (args.subpage_size != mtd->min_io_size)
+					normsg("may be sub-page size is incorrect?");
 				goto out_free;
 			}
 
-- 
2.6.2




More information about the barebox mailing list