From: Andre Przywara Subject: [PATCH 14/14] libfdt: fdt_strerror(): Fix comparison warning Date: Mon, 21 Sep 2020 17:53:03 +0100 Message-ID: <20200921165303.9115-15-andre.przywara@arm.com> References: <20200921165303.9115-1-andre.przywara@arm.com> Return-path: In-Reply-To: <20200921165303.9115-1-andre.przywara-5wv7dgnIgG8@public.gmane.org> List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Simon Glass , David Gibson Cc: Devicetree Compiler , Varun Wadekar With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_strerror(). At this point we are sure that errval is negative, and since FDT_ERRTABSIZE is surely positive, we can do some casting to make the compiler happy. Signed-off-by: Andre Przywara --- libfdt/fdt_strerror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfdt/fdt_strerror.c b/libfdt/fdt_strerror.c index 768db66..efce51d 100644 --- a/libfdt/fdt_strerror.c +++ b/libfdt/fdt_strerror.c @@ -48,7 +48,7 @@ const char *fdt_strerror(int errval) return ""; else if (errval == 0) return ""; - else if (errval > -FDT_ERRTABSIZE) { + else if (errval > -(int)FDT_ERRTABSIZE) { const char *s = fdt_errtable[-errval].str; if (s) -- 2.17.5