libfdt: fdt_mem_rsv(): Fix comparison warnings

With -Wsign-compare, compilers warn about a mismatching signedness
in comparisons in fdt_mem_rsv().

Since all involved values must be positive, change the used types to be
unsigned.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20200921165303.9115-3-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Andre Przywara 2020-09-21 17:52:51 +01:00 committed by David Gibson
parent 442ea3dd15
commit 0c43d4d7bf
1 changed files with 2 additions and 2 deletions

View File

@ -157,8 +157,8 @@ int fdt_generate_phandle(const void *fdt, uint32_t *phandle)

static const struct fdt_reserve_entry *fdt_mem_rsv(const void *fdt, int n)
{
int offset = n * sizeof(struct fdt_reserve_entry);
int absoffset = fdt_off_mem_rsvmap(fdt) + offset;
unsigned int offset = n * sizeof(struct fdt_reserve_entry);
unsigned int absoffset = fdt_off_mem_rsvmap(fdt) + offset;

if (!can_assume(VALID_INPUT)) {
if (absoffset < fdt_off_mem_rsvmap(fdt))