diff options
author | Andre Przywara <andre.przywara@arm.com> | 2020-10-01 17:46:28 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-12-14 16:00:44 +0100 |
commit | 58b4fe7cd59b7a31994bcd441fa9497ebb7d79bc (patch) | |
tree | 7e9804c6ab6123a35c812fa74be2638dfec672cf /cpukit/dtc/libfdt | |
parent | libfdt: fdt_create_with_flags(): Fix comparison warning (diff) | |
download | rtems-58b4fe7cd59b7a31994bcd441fa9497ebb7d79bc.tar.bz2 |
libfdt: libfdt_wip: Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness
in a comparison in fdt_setprop_inplace_namelen_partial().
fdt_getprop_namelen() will only return negative error values in "proplen"
if the return value is NULL. So we can rely on "proplen" being positive
in our case and can safely cast it to an unsigned type.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20201001164630.4980-5-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'cpukit/dtc/libfdt')
-rw-r--r-- | cpukit/dtc/libfdt/fdt_wip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/dtc/libfdt/fdt_wip.c b/cpukit/dtc/libfdt/fdt_wip.c index f64139e0b3..c2d7566a67 100644 --- a/cpukit/dtc/libfdt/fdt_wip.c +++ b/cpukit/dtc/libfdt/fdt_wip.c @@ -23,7 +23,7 @@ int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset, if (!propval) return proplen; - if (proplen < (len + idx)) + if ((unsigned)proplen < (len + idx)) return -FDT_ERR_NOSPACE; memcpy((char *)propval + idx, val, len); |