mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-26 23:04:50 +00:00
fix(lib/optee): correct signedness comparison
Avoid compilation errors with -Wsign-compare : "comparison of integer expressions of different signedness" by changing type of num to uint32_t. And change init_load_addr check. Change-Id: I891e4a288a964ffdb52129813ba8652c5bcf85b2 Signed-off-by: Yann Gautier <yann.gautier@st.com>
This commit is contained in:
parent
5657decc7f
commit
21d2be83a2
1 changed files with 9 additions and 5 deletions
|
@ -82,11 +82,14 @@ static int parse_optee_image(image_info_t *image_info,
|
||||||
init_size = image->size;
|
init_size = image->size;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* -1 indicates loader decided address; take our pre-mapped area
|
* image->load_addr_hi & image->load_addr_lo set to UINT32_MAX indicate
|
||||||
* for current image since arm-tf could not allocate memory dynamically
|
* loader decided address; take our pre-mapped area for current image
|
||||||
|
* since arm-tf could not allocate memory dynamically
|
||||||
*/
|
*/
|
||||||
if (init_load_addr == -1)
|
if ((image->load_addr_hi == UINT32_MAX) &&
|
||||||
|
(image->load_addr_lo == UINT32_MAX)) {
|
||||||
init_load_addr = image_info->image_base;
|
init_load_addr = image_info->image_base;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check that the default end address doesn't overflow */
|
/* Check that the default end address doesn't overflow */
|
||||||
if (check_uptr_overflow(image_info->image_base,
|
if (check_uptr_overflow(image_info->image_base,
|
||||||
|
@ -138,7 +141,8 @@ int parse_optee_header(entry_point_info_t *header_ep,
|
||||||
|
|
||||||
{
|
{
|
||||||
optee_header_t *header;
|
optee_header_t *header;
|
||||||
int num, ret;
|
uint32_t num;
|
||||||
|
int ret;
|
||||||
|
|
||||||
assert(header_ep);
|
assert(header_ep);
|
||||||
header = (optee_header_t *)header_ep->pc;
|
header = (optee_header_t *)header_ep->pc;
|
||||||
|
@ -181,7 +185,7 @@ int parse_optee_header(entry_point_info_t *header_ep,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse OPTEE image */
|
/* Parse OPTEE image */
|
||||||
for (num = 0; num < header->nb_images; num++) {
|
for (num = 0U; num < header->nb_images; num++) {
|
||||||
if (header->optee_image_list[num].image_id ==
|
if (header->optee_image_list[num].image_id ==
|
||||||
OPTEE_PAGER_IMAGE_ID) {
|
OPTEE_PAGER_IMAGE_ID) {
|
||||||
ret = parse_optee_image(pager_image_info,
|
ret = parse_optee_image(pager_image_info,
|
||||||
|
|
Loading…
Add table
Reference in a new issue