Browse Source

libfdt: fdt_grab_space_(): Fix comparison warning

With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_grab_space_().

All the involved values cannot be negative, so let's switch the types of
the local variables to unsigned to make the compiler happy.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20200921165303.9115-4-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Andre Przywara 4 years ago committed by David Gibson
parent
commit
f8e11e6162
  1. 4
      libfdt/fdt_sw.c

4
libfdt/fdt_sw.c

@ -93,8 +93,8 @@ static inline uint32_t sw_flags(void *fdt) @@ -93,8 +93,8 @@ static inline uint32_t sw_flags(void *fdt)

static void *fdt_grab_space_(void *fdt, size_t len)
{
int offset = fdt_size_dt_struct(fdt);
int spaceleft;
unsigned int offset = fdt_size_dt_struct(fdt);
unsigned int spaceleft;

spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt)
- fdt_size_dt_strings(fdt);

Loading…
Cancel
Save