From 1a765f51a41f51c7c194b6872a6d46f9dd5413f8 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 7 Dec 2006 15:24:26 +1100 Subject: [PATCH] libfdt: Fixups for 64-bit machines The error encoding for pointers is incorrect on machines where sizeof(int) != sizeof(void *), which includes most 64-bit platforms (in particular, AMD64 and powerpc64). This patch fixes it. --- libfdt_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfdt_internal.h b/libfdt_internal.h index 0d3e0a5..7dfa8df 100644 --- a/libfdt_internal.h +++ b/libfdt_internal.h @@ -41,7 +41,7 @@ const char *_fdt_find_string(const char *strtab, int tabsize, const char *s); int _fdt_node_end_offset(struct fdt_header *fdt, int nodeoffset); #define OFFSET_ERROR(code) -(code) -#define PTR_ERROR(code) (void *)(-(code)) +#define PTR_ERROR(code) (void *)(-(long)(code)) #define SW_MAGIC (~FDT_MAGIC)