9
0
Fork 0

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:
Wolfram Sang 2011-12-21 15:56:36 +01:00 committed by Sascha Hauer
parent bd8397e892
commit 3fada2bced
1 changed files with 0 additions and 10 deletions

View File

@ -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());