From 741a6d010d09b5bafca8e4cdfb6b2f8a2c07994d Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Thu, 25 Sep 2008 11:02:17 -0500 Subject: Fix an overflow case in fdt_offset_ptr() detected by GCC 4.3. Using Gcc 4.3 detected this problem: ../dtc/libfdt/fdt.c: In function 'fdt_next_tag': ../dtc/libfdt/fdt.c:82: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false To fix the problem, treat the offset as an unsigned int. The problem report and proposed fix were provided by Steve Papacharalambous . Signed-off-by: Jon Loeliger --- include/libfdt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/libfdt.h') diff --git a/include/libfdt.h b/include/libfdt.h index 94c35e330c..5492a53520 100644 --- a/include/libfdt.h +++ b/include/libfdt.h @@ -122,7 +122,7 @@ /* Low-level functions (you probably don't need these) */ /**********************************************************************/ -const void *fdt_offset_ptr(const void *fdt, int offset, int checklen); +const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen); static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) { return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen); -- cgit v1.2.3