aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2020-09-21 17:53:02 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2020-09-25 14:09:41 +1000
commit10f682788c3023d319cdc14f59ffe9d91cb6d2fc (patch)
tree37947f8505336240558d07f6feaf3bdefa1ec526
parent07158f4cf2a2fa2267b7a86f138a4f16ecb54172 (diff)
downloaddtc-10f682788c3023d319cdc14f59ffe9d91cb6d2fc.tar.gz
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>
-rw-r--r--libfdt/fdt_ro.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index ddb5a2d..e192184 100644
--- a/libfdt/fdt_ro.c
+++ b/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);