]> www.infradead.org Git - mtd-utils.git/commitdiff
ubiformat: really skip some messages when quiet
authorWolfram Sang <w.sang@pengutronix.de>
Sat, 20 Oct 2012 15:12:56 +0000 (17:12 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 12 Nov 2012 15:20:30 +0000 (17:20 +0200)
Both logic (only print when not quiet) and the indentation suggest that
the braces around the block have been forgotten.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
ubi-utils/ubiformat.c

index a265a9a0bb246d141e5bbc045493b1bb3db16263..8f9bd3ae93fc31be1d3b5811bdd3158211501de6 100644 (file)
@@ -875,11 +875,12 @@ int main(int argc, char * const argv[])
                 * erase counters.
                 */
                if (percent < 50) {
-                       if (!args.yes || !args.quiet)
+                       if (!args.yes || !args.quiet) {
                                warnmsg("only %d of %d eraseblocks have valid erase counter",
                                        si->ok_cnt, si->good_cnt);
                                normsg("erase counter 0 will be used for all eraseblocks");
                                normsg("note, arbitrary erase counter value may be specified using -e option");
+                       }
                        if (!args.yes && want_exit()) {
                                if (args.yes && !args.quiet)
                                        printf("yes\n");
@@ -888,11 +889,12 @@ int main(int argc, char * const argv[])
                         args.ec = 0;
                         args.override_ec = 1;
                } else if (percent < 95) {
-                       if (!args.yes || !args.quiet)
+                       if (!args.yes || !args.quiet) {
                                warnmsg("only %d of %d eraseblocks have valid erase counter",
                                        si->ok_cnt, si->good_cnt);
                                normsg("mean erase counter %lld will be used for the rest of eraseblock",
                                       si->mean_ec);
+                       }
                        if (!args.yes && want_exit()) {
                                if (args.yes && !args.quiet)
                                        printf("yes\n");