mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] command: flash: remove broken filename check
Date: Wed, 21 Dec 2011 15:56:36 +0100	[thread overview]
Message-ID: <1324479396-8185-1-git-send-email-w.sang@pengutronix.de> (raw)

It makes no sense to check the filename pointer here, because a) we have
already been using it and b) argc has been tested against 1 already, so
argv[1] should not be NULL. So, drop the checks.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 commands/flash.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/commands/flash.c b/commands/flash.c
index db7c87d..8237ac8 100644
--- a/commands/flash.c
+++ b/commands/flash.c
@@ -58,11 +58,6 @@ static int do_flerase(struct command *cmdtp, int argc, char *argv[])
 
 	size = s.st_size;
 
-	if (!filename) {
-		printf("missing filename\n");
-		return 1;
-	}
-
 	fd = open(filename, O_WRONLY);
 	if (fd < 0) {
 		printf("open %s: %s", filename, errno_str());
@@ -136,11 +131,6 @@ static int do_protect(struct command *cmdtp, int argc, char *argv[])
 
 	size = s.st_size;
 
-	if (!filename) {
-		printf("missing filename\n");
-		return 1;
-	}
-
 	fd = open(filename, O_WRONLY);
 	if (fd < 0) {
 		printf("open %s: %s", filename, errno_str());
-- 
1.7.7.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2011-12-21 14:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1324479396-8185-1-git-send-email-w.sang@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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