[U-Boot] [PATCH] boot_fit: Fix warning: overflow in implicit constant conversion in fdt_offset()

Nobuhiro Iwamatsu iwamatsu at nigauri.org
Wed Aug 2 23:10:25 UTC 2017


FDT_ERROR is defined as unsigned long. However, since the return value of
fdt_offset() is int, a warning will occur when compiling.
This fixes this problem by cast to int when setting FDT_ERROR as return value.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
CC: Franklin S Cooper Jr <fcooper at ti.com>
---
 common/boot_fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/boot_fit.c b/common/boot_fit.c
index 51440a6e6f..ca130f2308 100644
--- a/common/boot_fit.c
+++ b/common/boot_fit.c
@@ -25,7 +25,7 @@ int fdt_offset(void *fit)
 	images = fdt_path_offset(fit, FIT_IMAGES_PATH);
 	if (images < 0) {
 		debug("%s: Cannot find /images node: %d\n", __func__, images);
-		return FDT_ERROR;
+		return (int)FDT_ERROR;
 	}
 
 	fdt_name = fdt_getprop(fit, node, FIT_FDT_PROP, &fdt_len);
-- 
2.13.2



More information about the U-Boot mailing list