summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2020-09-21 17:53:02 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-12-14 16:00:44 +0100
commit26bee335477cf8358a0e5fde19cfc833f83d7633 (patch)
tree919ee076cd012b65b12088753431f0824a6f9b84 /cpukit
parentlibfdt: fdt_resize(): Fix comparison warning (diff)
downloadrtems-26bee335477cf8358a0e5fde19cfc833f83d7633.tar.bz2
libfdt: fdt_node_offset_by_phandle(): Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_node_offset_by_phandle(). Uses a better suited bitwise NOT operator to denote the special value of -1, which automatically results in an unsigned type. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20200921165303.9115-14-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/dtc/libfdt/fdt_ro.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/dtc/libfdt/fdt_ro.c b/cpukit/dtc/libfdt/fdt_ro.c
index ddb5a2db28..e19218422f 100644
--- a/cpukit/dtc/libfdt/fdt_ro.c
+++ b/cpukit/dtc/libfdt/fdt_ro.c
@@ -680,7 +680,7 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
{
int offset;
- if ((phandle == 0) || (phandle == -1))
+ if ((phandle == 0) || (phandle == ~0U))
return -FDT_ERR_BADPHANDLE;
FDT_RO_PROBE(fdt);