]> www.infradead.org Git - mtd-utils.git/commitdiff
ubiformat: fix the subpage size hint on the error path
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 8 Sep 2014 12:05:54 +0000 (15:05 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 16 Sep 2014 15:11:50 +0000 (18:11 +0300)
David Binderman <dcb314@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@linux.intel.com>
ubi-utils/ubiformat.c

index 1b8f6fb108a283dea380d7bf355c2b7be5e198b1..21409ca695fb7c0c03725c69913415c8297cfcc5 100644 (file)
@@ -633,9 +633,8 @@ static int format(libmtd_t libmtd, 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;
                        }