powerpc/boot/fdt: Use unsigned long for pointer casts
authorJeremy Kerr <jk@ozlabs.org>
Wed, 11 Feb 2015 04:55:44 +0000 (12:55 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 16 Mar 2015 07:58:30 +0000 (18:58 +1100)
Now that the wrapper supports 64-bit builds, we see warnings when
attempting to cast pointers to int. Use unsigned long instead.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/boot/libfdt-wrapper.c

index bb8b9b3505eecd5ce694371f0ababf41f4cf65b1..535e8fd8900da3a2445ccb9e8941e9e7a7cf9a57 100644 (file)
 
 #define offset_devp(off)       \
        ({ \
-               int _offset = (off); \
+               unsigned long _offset = (off); \
                check_err(_offset) ? NULL : (void *)(_offset+1); \
        })
 
-#define devp_offset_find(devp) (((int)(devp))-1)
-#define devp_offset(devp)      (devp ? ((int)(devp))-1 : 0)
+#define devp_offset_find(devp) (((unsigned long)(devp))-1)
+#define devp_offset(devp)      (devp ? ((unsigned long)(devp))-1 : 0)
 
 static void *fdt;
 static void *buf; /* = NULL */