From 10f682788c3023d319cdc14f59ffe9d91cb6d2fc Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Mon, 21 Sep 2020 17:53:02 +0100 Subject: 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 Message-Id: <20200921165303.9115-14-andre.przywara@arm.com> Signed-off-by: David Gibson --- libfdt/fdt_ro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libfdt') 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); -- cgit v1.1