mkimage: Return struct image_tool_params to struct imgtool

The existing name is confusing since it includes state as well as
parameters. In fact it includes nearly everything known about the tool
while it is running. Rename the struct to imgtool to reflect this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-07-31 11:50:28 +12:00
parent fe1300387b
commit 8855e0de5c
38 changed files with 199 additions and 202 deletions

View File

@@ -33,20 +33,20 @@ static int image_check_image_types(uint8_t type)
return EXIT_FAILURE;
}
static int image_check_params(struct image_tool_params *params)
static int image_check_params(struct imgtool *params)
{
return ((params->dflag && (params->fflag || params->lflag)) ||
(params->fflag && (params->dflag || params->lflag)) ||
(params->lflag && (params->dflag || params->fflag)));
}
static void image_print_header(const void *ptr, struct image_tool_params *params)
static void image_print_header(const void *ptr, struct imgtool *params)
{
image_print_contents(ptr);
}
static int image_verify_header(unsigned char *ptr, int image_size,
struct image_tool_params *params)
struct imgtool *params)
{
uint32_t len;
const unsigned char *data;
@@ -108,7 +108,7 @@ static int image_verify_header(unsigned char *ptr, int image_size,
}
static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
struct image_tool_params *params)
struct imgtool *params)
{
uint32_t checksum;
time_t time;
@@ -165,7 +165,7 @@ static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
image_set_hcrc(hdr, checksum);
}
static int image_extract_subimage(void *ptr, struct image_tool_params *params)
static int image_extract_subimage(void *ptr, struct imgtool *params)
{
const struct legacy_img_hdr *hdr = (const struct legacy_img_hdr *)ptr;
ulong file_data;