From: Simon Glass Date: Sun, 1 May 2016 11:35:53 -0600 Subject: [U-Boot] [PATCH v2 05/44] Allow iotrace byte access to use an address of any size In-Reply-To: <1462124192-8748-1-git-send-email-sjg@chromium.org> References: <1462124192-8748-1-git-send-email-sjg@chromium.org> Message-ID: <1462124192-8748-6-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- Changes in v2: - Tweak the cast include/iotrace.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/iotrace.h b/include/iotrace.h index 9bd1f16..e4ceb61 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 -- 2.8.0.rc3.226.g39d4020