From patchwork Sat Oct 20 15:12:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 192921 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9FE4A2C0080 for ; Sun, 21 Oct 2012 02:15:02 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TPajx-00061u-At; Sat, 20 Oct 2012 15:13:29 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TPajr-00061W-9h for linux-mtd@lists.infradead.org; Sat, 20 Oct 2012 15:13:24 +0000 Received: from gallifrey.ext.pengutronix.de ([2001:6f8:1178:4:5054:ff:fe8d:eefb] helo=pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1TPaji-00036X-O9; Sat, 20 Oct 2012 17:13:18 +0200 From: Wolfram Sang To: linux-mtd@lists.infradead.org Subject: [PATCH] ubiformat: really skip some messages when quiet Date: Sat, 20 Oct 2012 17:12:56 +0200 Message-Id: <1350745976-1774-1-git-send-email-w.sang@pengutronix.de> X-Mailer: git-send-email 1.7.10.4 X-SA-Exim-Connect-IP: 2001:6f8:1178:4:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: w.sang@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mtd@lists.infradead.org X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Wolfram Sang X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 --- ubi-utils/ubiformat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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");