[PATCH] command: flash: remove broken filename check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux