linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Brian Norris" <computersforpeace@gmail.com>
To: "Mike Frysinger" <vapier.adi@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	linux-mtd@lists.infradead.org,
	Artem Bityutskiy <dedekind1@gmail.com>
Subject: [PATCH v2 7/8] nandwrite: add check for negative blockalign
Date: Tue, 30 Nov 2010 22:19:44 -0800	[thread overview]
Message-ID: <1291184384-4665-1-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <1291017722-23985-7-git-send-email-computersforpeace@gmail.com>

Includes error messages for negative blockalign, telling the user what
the offending option and value were.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 nandwrite.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/nandwrite.c b/nandwrite.c
index 5373a89..2e45136 100644
--- a/nandwrite.c
+++ b/nandwrite.c
@@ -218,6 +218,10 @@ static void process_options(int argc, char * const argv[])
 		exit(EXIT_FAILURE);
 	}
 
+	if (blockalign < 0)
+		errmsg_die("Can't specify negative blockalign with option -b:"
+				" %d", blockalign);
+
 	argc -= optind;
 	argv += optind;
 
-- 
1.7.0.4

  parent reply	other threads:[~2010-12-01  6:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-29  8:01 [PATCH 1/8] nanddump/nandwrite: use "simple_" str functions Brian Norris
2010-11-29  8:01 ` [PATCH 2/8] mtd-utils: common.h: Add MAX() macro, fix MIN() Brian Norris
2010-11-29  8:01 ` [PATCH 3/8] nanddump: Refactor pretty print code into an sprintf() Brian Norris
2010-11-29  8:01 ` [PATCH 4/8] nanddump: change "unsigned" to "signed" Brian Norris
2010-11-29  8:01 ` [PATCH 5/8] nanddump: check for negative inputs Brian Norris
2010-12-01  6:18   ` [PATCH v2 " Brian Norris
2010-12-01  7:12     ` [PATCH v3 " Brian Norris
2010-11-29  8:02 ` [PATCH 6/8] nanddump: choose correct "printf" format-specifier Brian Norris
2010-11-29  8:02 ` [PATCH 7/8] nandwrite: add check for negative blockalign Brian Norris
2010-11-29  8:05   ` Mike Frysinger
2010-12-01  6:11     ` Brian Norris
2010-12-01  6:19   ` Brian Norris [this message]
2010-11-29  8:02 ` [PATCH 8/8] nandwrite: use common.h "errmsg_die" Brian Norris
2010-12-01  6:20   ` [PATCH v2 " Brian Norris
2010-12-02  3:27 ` [PATCH 1/8] nanddump/nandwrite: use "simple_" str functions Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291184384-4665-1-git-send-email-computersforpeace@gmail.com \
    --to=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vapier.adi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).