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 <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
bd8397e892
commit
3fada2bced
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue