
The current mkimage code is a bit messy: - the main() function is very long - two similarly named structs are used throughout: the first (struct image_tool_params) is not actually just parameters, the second (struct image_type_params) is confusingly similar - quite a bit of FIT processing happens right at the start of main(), which can be hard to follow - the program calls exit() from many different places This series renames the main structures, avoiding using the common 'params' word. It breaks up part of main() into separate functions and starts the process of exiting in one place. It also reverts a patch which causes an invalid 'loadables' property to be added with '-f auto'. More remains to be done, but this is a start. Simon Glass (21): mkimage: Move copy_file() higher in the file mkimage: Move code from main() to a new function mkimage: Return the exist code from run_mkimage() mkimage: Update usage() to return a value mkimage: Rename struct image_type_params to imgtool_funcs mkimage: Return struct image_tool_params to struct imgtool mkimage: Use a consistent parameter for struct imgtool * mkimage: Pass struct imgtool out from main() mkimage: Update add_content() to take an imgtool parameter mkimage: Update process_args() to take an imgtool parameter mkimage: Update verify_image() to take an imgtool parameter mkimage: Update copy_file() etc. to take an imgtool parameter mkimage: Update run_mkimage() to take an imgtool parameter mkimage: Drop the global for struct imgtool mkimage: Update process_args() to return a value always mkimage: Update verify_image() to return a value always mkimage: Update copy_file() et al to return a value always mkimage: Split out initial checking and processing mkimage: Split out file-opening into its own function mkimage: Move the list-or-process code into a function Revert "tools: fit_image: Add the loadable property to configs" tools/aisimage.c | 57 ++- tools/atmelimage.c | 27 +- tools/default_image.c | 54 +-- tools/dumpimage.c | 8 +- tools/fit_common.c | 5 +- tools/fit_common.h | 7 +- tools/fit_image.c | 239 ++++++----- tools/gpheader.h | 2 +- tools/gpimage-common.c | 8 +- tools/gpimage.c | 8 +- tools/imagetool.c | 56 +-- tools/imagetool.h | 67 ++- tools/imx8image.c | 12 +- tools/imx8mimage.c | 8 +- tools/imximage.c | 41 +- tools/kwbimage.c | 164 +++---- tools/lpc32xximage.c | 6 +- tools/mkimage.c | 869 +++++++++++++++++++++----------------- tools/mtk_image.c | 26 +- tools/mxsimage.c | 37 +- tools/omapimage.c | 11 +- tools/pblimage.c | 40 +- tools/renesas_spkgimage.c | 35 +- tools/rkcommon.c | 109 +++-- tools/rkcommon.h | 20 +- tools/rkimage.c | 8 +- tools/rkspi.c | 17 +- tools/sfspl.c | 25 +- tools/socfpgaimage.c | 66 ++- tools/stm32image.c | 10 +- tools/sunxi_egon.c | 37 +- tools/sunxi_toc0.c | 29 +- tools/ublimage.c | 24 +- tools/vybridimage.c | 6 +- tools/zynqimage.c | 24 +- tools/zynqmpbif.c | 14 +- tools/zynqmpimage.c | 42 +- tools/zynqmpimage.h | 2 +- 38 files changed, 1138 insertions(+), 1082 deletions(-) -- 2.43.0 base-commit: 816236b75e1b9248d282fb81e0c77426add8385a branch: loadd