From 3fada2bcedf668f9d2eca1971bb8a225dc03f645 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 21 Dec 2011 15:56:36 +0100 Subject: command: flash: remove broken filename check 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 Signed-off-by: Sascha Hauer --- commands/flash.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'commands/flash.c') diff --git a/commands/flash.c b/commands/flash.c index a3f3508f2f..85efd06e43 100644 --- a/commands/flash.c +++ b/commands/flash.c @@ -56,11 +56,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()); @@ -132,11 +127,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()); -- cgit v1.2.3