[PATCH 2/3] flash_eraseall: move constants out of for loop
Shevchenko Andriy (EXT-Teleca/Helsinki)
ext-andriy.shevchenko at nokia.com
Thu Jun 17 04:42:38 EDT 2010
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko at nokia.com>
---
flash_eraseall.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/flash_eraseall.c b/flash_eraseall.c
index a22fc49..f6319d1 100644
--- a/flash_eraseall.c
+++ b/flash_eraseall.c
@@ -194,21 +194,21 @@ void process_options (int argc, char *argv[])
{
int error = 0;
+ static const char *short_options = "jq";
+ static const struct option long_options[] = {
+ {"help", no_argument, 0, 0},
+ {"version", no_argument, 0, 0},
+ {"jffs2", no_argument, 0, 'j'},
+ {"quiet", no_argument, 0, 'q'},
+ {"silent", no_argument, 0, 'q'},
+
+ {0, 0, 0, 0},
+ };
+
exe_name = argv[0];
for (;;) {
int option_index = 0;
- static const char *short_options = "jq";
- static const struct option long_options[] = {
- {"help", no_argument, 0, 0},
- {"version", no_argument, 0, 0},
- {"jffs2", no_argument, 0, 'j'},
- {"quiet", no_argument, 0, 'q'},
- {"silent", no_argument, 0, 'q'},
-
- {0, 0, 0, 0},
- };
-
int c = getopt_long(argc, argv, short_options,
long_options, &option_index);
if (c == EOF) {
--
1.6.3.3
More information about the linux-mtd
mailing list