[rtems commit] libfdt: fdt_node_offset_by_phandle(): Fix comparison warning
Sebastian Huber
sebh at rtems.org
Thu Dec 16 13:58:33 UTC 2021
Module: rtems
Branch: master
Commit: 26bee335477cf8358a0e5fde19cfc833f83d7633
Changeset: http://git.rtems.org/rtems/commit/?id=26bee335477cf8358a0e5fde19cfc833f83d7633
Author: Andre Przywara <andre.przywara at arm.com>
Date: Mon Sep 21 17:53:02 2020 +0100
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 at arm.com>
Message-Id: <20200921165303.9115-14-andre.przywara at arm.com>
Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
cpukit/dtc/libfdt/fdt_ro.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpukit/dtc/libfdt/fdt_ro.c b/cpukit/dtc/libfdt/fdt_ro.c
index ddb5a2d..e192184 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);
More information about the vc
mailing list