From 8edeac86db306482b9bcb860d572320a8c3ed95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= Date: Tue, 3 May 2016 15:17:03 +0200 Subject: mkimage: fix generation of FIT image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 7a439cadcf3192eb012a2432ca34670b676c74d2 broke generation of SPL loadable FIT images (CONFIG_SPL_LOAD_FIT). Fix it by removing the unnecessary storage of expected image type. This was a left over of the previous implementation. It is not longer necessary since the mkimage -b switch always has one parameter. Tested-by: Lokesh Vutla Signed-off-by: Andreas Bießmann --- tools/mkimage.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/mkimage.c b/tools/mkimage.c index b407aed742..93d1c16c7c 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -133,10 +133,8 @@ static void process_args(int argc, char **argv) char *ptr; int type = IH_TYPE_INVALID; char *datafile = NULL; - int expecting; int opt; - expecting = IH_TYPE_COUNT; /* Unknown */ while ((opt = getopt(argc, argv, "a:A:b:cC:d:D:e:Ef:Fk:K:ln:O:rR:sT:vVx")) != -1) { switch (opt) { @@ -154,8 +152,7 @@ static void process_args(int argc, char **argv) usage("Invalid architecture"); break; case 'b': - expecting = IH_TYPE_FLATDT; - if (add_content(expecting, optarg)) { + if (add_content(IH_TYPE_FLATDT, optarg)) { fprintf(stderr, "%s: Out of memory adding content '%s'", params.cmdname, optarg); @@ -238,7 +235,6 @@ static void process_args(int argc, char **argv) show_image_types(); usage("Invalid image type"); } - expecting = type; break; case 'v': params.vflag++; @@ -254,7 +250,8 @@ static void process_args(int argc, char **argv) } } - if (optind < argc && expecting == type) + /* The last parameter is expected to be the imagefile */ + if (optind < argc) params.imagefile = argv[optind]; /* -- cgit v1.2.1