From: Simon Glass <sjg@chromium.org>
Date: Sun, 1 May 2016 17:35:53 +0000 (-0600)
Subject: Allow iotrace byte access to use an address of any size
X-Git-Tag: v2025.01-rc5-pxa1908~9458^2~62
X-Git-Url: http://git.dujemihanovic.xyz/%22http:/kyber.dk/phpMyBuilder/static/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=709e98b7b2461c2535d4ac2bb0311c3b3f53dbbb;p=u-boot.git

Allow iotrace byte access to use an address of any size

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>
---

diff --git a/include/iotrace.h b/include/iotrace.h
index 9bd1f167ab..e4ceb61805 100644
--- a/include/iotrace.h
+++ b/include/iotrace.h
@@ -31,10 +31,11 @@
 #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