Patchwork ubiformat: really skip some messages when quiet

login
register
mail settings
Submitter Wolfram Sang
Date Oct. 20, 2012, 3:12 p.m.
Message ID <1350745976-1774-1-git-send-email-w.sang@pengutronix.de>
Download mbox | patch
Permalink /patch/192921/
State New
Headers show

Comments

Wolfram Sang - Oct. 20, 2012, 3:12 p.m.
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>
---
 ubi-utils/ubiformat.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Artem Bityutskiy - Nov. 12, 2012, 3:20 p.m.
On Sat, 2012-10-20 at 17:12 +0200, Wolfram Sang wrote:
> 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>

Pushed to mtd-utils.git, thanks!

Patch

diff --git a/ubi-utils/ubiformat.c b/ubi-utils/ubiformat.c
index a265a9a..8f9bd3a 100644
--- a/ubi-utils/ubiformat.c
+++ b/ubi-utils/ubiformat.c
@@ -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");