Allow iotrace byte access to use an address of any size
authorSimon Glass <sjg@chromium.org>
Sun, 1 May 2016 17:35:53 +0000 (11:35 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 17 May 2016 15:54:43 +0000 (09:54 -0600)
If an address is used with readb() and writeb() which is smaller than the
expected size (e.g. 32-bit value on a machine with 64-bit addresses), a
warning results. Fix this by adding a cast.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/iotrace.h

index 9bd1f167abe5ea3c4a9d61df1338af7fb6f28b81..e4ceb6180537ed62ce4ae96f60ca56268ab9f5e8 100644 (file)
 #define writew(val, addr)      iotrace_writew(val, (const void *)(addr))
 
 #undef readb
-#define readb(addr)    iotrace_readb((const void *)(addr))
+#define readb(addr)    iotrace_readb((const void *)(uintptr_t)addr)
 
 #undef writeb
-#define writeb(val, addr)      iotrace_writeb(val, (const void *)(addr))
+#define writeb(val, addr) \
+       iotrace_writeb(val, (const void *)(uintptr_t)addr)
 
 #endif