mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
libfdt: Fix signedness comparison warnings
This is a combination of upstream libfdt commits to fix warnings about comparing signed and unsigned integers: ========== scripts/dtc/libfdt/fdt.c: In function ‘fdt_offset_ptr’: scripts/dtc/libfdt/fdt.c:137:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if ((absoffset < offset) ... ========== For a detailed description of the fixes, see the dtc repo: https://git.kernel.org/pub/scm/utils/dtc/dtc.git/log/?id=73e0f143b73d808 For this patch the commits between 73e0f143b73d8088 and ca19c3db2bf62000 have been combined and adjusted for the slight differences in U-Boot's libfdt code base. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
This commit is contained in:
parent
f36603c7a8
commit
832bfad745
6 changed files with 42 additions and 29 deletions
|
@ -40,7 +40,7 @@ static struct fdt_errtabent fdt_errtable[] = {
|
|||
FDT_ERRTABENT(FDT_ERR_NOPHANDLES),
|
||||
FDT_ERRTABENT(FDT_ERR_BADFLAGS),
|
||||
};
|
||||
#define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
|
||||
#define FDT_ERRTABSIZE ((int)(sizeof(fdt_errtable) / sizeof(fdt_errtable[0])))
|
||||
|
||||
const char *fdt_strerror(int errval)
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ const char *fdt_strerror(int errval)
|
|||
return "<valid offset/length>";
|
||||
else if (errval == 0)
|
||||
return "<no error>";
|
||||
else if (errval > -FDT_ERRTABSIZE) {
|
||||
else if (-errval < FDT_ERRTABSIZE) {
|
||||
const char *s = fdt_errtable[-errval].str;
|
||||
|
||||
if (s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue