summaryrefslogtreecommitdiff
path: root/tools/mkimage.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-02-22 22:55:35 -0700
committerTom Rini <trini@konsulko.com>2016-03-14 14:19:10 -0400
commit0745008145e0a30db06b21533512893ba0f706a2 (patch)
treef9a40f20dbf82858144e94c5a24772727340ab8d /tools/mkimage.c
parenta02221f29deb88145f6a1494450a8b9d20c9d596 (diff)
downloadu-boot-imx-0745008145e0a30db06b21533512893ba0f706a2.zip
u-boot-imx-0745008145e0a30db06b21533512893ba0f706a2.tar.gz
u-boot-imx-0745008145e0a30db06b21533512893ba0f706a2.tar.bz2
mkimage: Sort the option processing code by option
Adjust the code so that option alphabetical order matches the order in the switch() statement. This makes it easier to find options. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/mkimage.c')
-rw-r--r--tools/mkimage.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c
index f0cc53d..89d3c97 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -75,8 +75,13 @@ static void process_args(int argc, char **argv)
while ((opt = getopt(argc, argv,
"a:A:cC:d:D:e:f:Fk:K:ln:O:rR:sT:vVx")) != -1) {
switch (opt) {
- case 'l':
- params.lflag = 1;
+ case 'a':
+ params.addr = strtoull(optarg, &ptr, 16);
+ if (*ptr) {
+ fprintf(stderr, "%s: invalid load address %s\n",
+ params.cmdname, optarg);
+ exit(EXIT_FAILURE);
+ }
break;
case 'A':
params.arch = genimg_get_arch_id(optarg);
@@ -91,33 +96,13 @@ static void process_args(int argc, char **argv)
if (params.comp < 0)
usage();
break;
- case 'D':
- params.dtc = optarg;
- break;
- case 'O':
- params.os = genimg_get_os_id(optarg);
- if (params.os < 0)
- usage();
- break;
- case 'T':
- params.type = genimg_get_type_id(optarg);
- if (params.type < 0) {
- show_image_types();
- usage();
- }
- break;
- case 'a':
- params.addr = strtoull(optarg, &ptr, 16);
- if (*ptr) {
- fprintf(stderr, "%s: invalid load address %s\n",
- params.cmdname, optarg);
- exit(EXIT_FAILURE);
- }
- break;
case 'd':
params.datafile = optarg;
params.dflag = 1;
break;
+ case 'D':
+ params.dtc = optarg;
+ break;
case 'e':
params.ep = strtoull(optarg, &ptr, 16);
if (*ptr) {
@@ -144,9 +129,17 @@ static void process_args(int argc, char **argv)
case 'K':
params.keydest = optarg;
break;
+ case 'l':
+ params.lflag = 1;
+ break;
case 'n':
params.imagename = optarg;
break;
+ case 'O':
+ params.os = genimg_get_os_id(optarg);
+ if (params.os < 0)
+ usage();
+ break;
case 'r':
params.require_keys = 1;
break;
@@ -160,6 +153,13 @@ static void process_args(int argc, char **argv)
case 's':
params.skipcpy = 1;
break;
+ case 'T':
+ params.type = genimg_get_type_id(optarg);
+ if (params.type < 0) {
+ show_image_types();
+ usage();
+ }
+ break;
case 'v':
params.vflag++;
break;