diff options
author | Sascha Hauer <sha@pengutronix.de> | 2009-10-17 12:49:47 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-10-19 10:18:52 +0200 |
commit | 63e01b4969c9eef70b45df279f43a786b0cb2c09 (patch) | |
tree | e032002d8e78e631b00572cf4937b9c72c651d47 /commands | |
parent | 87e01f28ccc85474e18e1218c9d84f98e2e8977d (diff) | |
download | barebox-63e01b4969c9eef70b45df279f43a786b0cb2c09.tar.gz barebox-63e01b4969c9eef70b45df279f43a786b0cb2c09.tar.xz |
call getopt_reset only once
instead of calling getopt_reset in each command,
call it only once before calling the command.
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/bmp.c | 2 | ||||
-rw-r--r-- | commands/bootm.c | 2 | ||||
-rw-r--r-- | commands/crc.c | 2 | ||||
-rw-r--r-- | commands/dfu.c | 1 | ||||
-rw-r--r-- | commands/loadb.c | 2 | ||||
-rw-r--r-- | commands/ls.c | 2 | ||||
-rw-r--r-- | commands/mem.c | 2 | ||||
-rw-r--r-- | commands/mkdir.c | 2 | ||||
-rw-r--r-- | commands/nand.c | 2 | ||||
-rw-r--r-- | commands/timeout.c | 2 |
10 files changed, 0 insertions, 19 deletions
diff --git a/commands/bmp.c b/commands/bmp.c index b7b7c9f5fa..22d7275d8f 100644 --- a/commands/bmp.c +++ b/commands/bmp.c @@ -45,8 +45,6 @@ static int do_bmp(cmd_tbl_t *cmdtp, int argc, char *argv[]) int offscreen = 0; void *adr, *buf; - getopt_reset(); - while((opt = getopt(argc, argv, "f:x:y:o")) > 0) { switch(opt) { case 'f': diff --git a/commands/bootm.c b/commands/bootm.c index b9c58b1414..9e16e06815 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -377,8 +377,6 @@ static int do_bootm (cmd_tbl_t *cmdtp, int argc, char *argv[]) memset(&data, 0, sizeof(struct image_data)); data.verify = 1; - getopt_reset(); - /* Collect options from registered handlers */ strcpy(options, "nh"); list_for_each_entry(handler, &handler_list, list) { diff --git a/commands/crc.c b/commands/crc.c index 7ac69c60f9..d828bc987c 100644 --- a/commands/crc.c +++ b/commands/crc.c @@ -38,8 +38,6 @@ static int do_crc (cmd_tbl_t *cmdtp, int argc, char *argv[]) char *buf; int fd, opt, err = 0, filegiven = 0, verify = 0, now; - getopt_reset(); - while((opt = getopt(argc, argv, "f:v:")) > 0) { switch(opt) { case 'f': diff --git a/commands/dfu.c b/commands/dfu.c index d35b129651..fae77021c0 100644 --- a/commands/dfu.c +++ b/commands/dfu.c @@ -105,7 +105,6 @@ static int do_dfu(cmd_tbl_t *cmdtp, int argc, char *argv[]) char *productname = CONFIG_BOARDINFO; u16 idVendor = 0, idProduct = 0; - getopt_reset(); while((opt = getopt(argc, argv, "m:p:V:P:")) > 0) { switch(opt) { diff --git a/commands/loadb.c b/commands/loadb.c index 890e977b2f..1fdf94487b 100644 --- a/commands/loadb.c +++ b/commands/loadb.c @@ -699,8 +699,6 @@ static int do_load_serial_bin(cmd_tbl_t *cmdtp, int argc, char *argv[]) char *output_file = NULL; struct console_device *cdev = NULL; - getopt_reset(); - while ((opt = getopt(argc, argv, "f:b:o:c")) > 0) { switch (opt) { case 'f': diff --git a/commands/ls.c b/commands/ls.c index 85fe8b53f4..2522546472 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -118,8 +118,6 @@ static int do_ls (cmd_tbl_t *cmdtp, int argc, char *argv[]) ulong flags = LS_COLUMN; struct string_list sl; - getopt_reset(); - while((opt = getopt(argc, argv, "RCl")) > 0) { switch(opt) { case 'R': diff --git a/commands/mem.c b/commands/mem.c index b31a8f47d1..dd6c497c51 100644 --- a/commands/mem.c +++ b/commands/mem.c @@ -138,8 +138,6 @@ static int mem_parse_options(int argc, char *argv[], char *optstr, int *mode, { int opt; - getopt_reset(); - while((opt = getopt(argc, argv, optstr)) > 0) { switch(opt) { case 'b': diff --git a/commands/mkdir.c b/commands/mkdir.c index 4d9bcb602b..a9c0b45356 100644 --- a/commands/mkdir.c +++ b/commands/mkdir.c @@ -30,8 +30,6 @@ static int do_mkdir (cmd_tbl_t *cmdtp, int argc, char *argv[]) { int opt, parent = 0, ret; - getopt_reset(); - while((opt = getopt(argc, argv, "p")) > 0) { switch(opt) { case 'p': diff --git a/commands/nand.c b/commands/nand.c index acec327dcd..b690966f65 100644 --- a/commands/nand.c +++ b/commands/nand.c @@ -271,8 +271,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int argc, char *argv[]) struct nand_bb *bb; int command = 0, badblock = 0; - getopt_reset(); - while((opt = getopt(argc, argv, "adb:")) > 0) { if (command) { printf("only one command may be given\n"); diff --git a/commands/timeout.c b/commands/timeout.c index dbf17a7906..8093959216 100644 --- a/commands/timeout.c +++ b/commands/timeout.c @@ -37,8 +37,6 @@ static int do_timeout(cmd_tbl_t *cmdtp, int argc, char *argv[]) int flags = 0, opt, countdown; uint64_t start, second; - getopt_reset(); - while((opt = getopt(argc, argv, "t:crsa")) > 0) { switch(opt) { case 'r': |