common: image-fit: correct fit_set_totalsize()

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2febc67bf0b16611cd54afad75fa79ac7454f4a5
This commit is contained in:
Joseph Chen 2020-06-01 14:42:33 +08:00
parent 012d0ecf96
commit ca0130caa2
2 changed files with 3 additions and 7 deletions

View File

@ -1094,7 +1094,7 @@ int fit_set_timestamp(void *fit, int noffset, time_t timestamp)
return 0;
}
int fit_set_totalsize(void *fit, int noffset, time_t totalsize)
int fit_set_totalsize(void *fit, int noffset, int totalsize)
{
uint32_t t;
int ret;
@ -1102,12 +1102,8 @@ int fit_set_totalsize(void *fit, int noffset, time_t totalsize)
t = cpu_to_uimage(totalsize);
ret = fdt_setprop(fit, noffset, FIT_TOTALSIZE_PROP, &t,
sizeof(uint32_t));
if (ret) {
printf("Can't set '%s' property for '%s' node (%s)\n",
FIT_TOTALSIZE_PROP, fit_get_name(fit, noffset, NULL),
fdt_strerror(ret));
if (ret)
return ret == -FDT_ERR_NOSPACE ? -ENOSPC : -1;
}
return 0;
}

View File

@ -1026,7 +1026,7 @@ int fit_image_check_hash(const void *fit, int noffset, const void *data,
size_t size, char **err_msgp);
int fit_set_timestamp(void *fit, int noffset, time_t timestamp);
int fit_set_totalsize(void *fit, int noffset, time_t totalsize);
int fit_set_totalsize(void *fit, int noffset, int totalsize);
int fit_get_image_defconf_node(const void *fit,
int *images_noffset, int *def_noffset);