Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262568AbUKLQqT (ORCPT ); Fri, 12 Nov 2004 11:46:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262559AbUKLQoW (ORCPT ); Fri, 12 Nov 2004 11:44:22 -0500 Received: from l247150.ppp.asahi-net.or.jp ([218.219.247.150]:10440 "EHLO mitou.ysato.dip.jp") by vger.kernel.org with ESMTP id S262571AbUKLQmJ (ORCPT ); Fri, 12 Nov 2004 11:42:09 -0500 Date: Sat, 13 Nov 2004 01:42:07 +0900 Message-ID: From: Yoshinori Sato To: Linus Torvalds , Andrew Morton Cc: linux-kernel@vger.kernel.org Subject: [PATCH] H8/300 read{b,w,l} / write{b,w,l} error fix User-Agent: Wanderlust/2.11.30 (Wonderwall) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2046 Lines: 45 Signed-off-by: Yoshinori Sato diff -Nru a/include/asm-h8300/io.h b/include/asm-h8300/io.h --- a/include/asm-h8300/io.h 2004-11-13 01:12:50 +09:00 +++ b/include/asm-h8300/io.h 2004-11-13 01:12:50 +09:00 @@ -70,15 +70,24 @@ } #define readb(addr) \ - ({ unsigned char __v = (*(volatile unsigned char *) ((addr) & 0x00ffffff)); __v; }) + ({ unsigned char __v = \ + *(volatile unsigned char *)((unsigned long)(addr) & 0x00ffffff); \ + __v; }) #define readw(addr) \ - ({ unsigned short __v = (*(volatile unsigned short *) ((addr) & 0x00ffffff)); __v; }) + ({ unsigned short __v = \ + *(volatile unsigned short *)((unsigned long)(addr) & 0x00ffffff); \ + __v; }) #define readl(addr) \ - ({ unsigned int __v = (*(volatile unsigned int *) ((addr) & 0x00ffffff)); __v; }) + ({ unsigned long __v = \ + *(volatile unsigned long *)((unsigned long)(addr) & 0x00ffffff); \ + __v; }) -#define writeb(b,addr) (void)((*(volatile unsigned char *) ((addr) & 0x00ffffff)) = (b)) -#define writew(b,addr) (void)((*(volatile unsigned short *) ((addr) & 0x00ffffff)) = (b)) -#define writel(b,addr) (void)((*(volatile unsigned int *) ((addr) & 0x00ffffff)) = (b)) +#define writeb(b,addr) (void)((*(volatile unsigned char *) \ + ((unsigned long)(addr) & 0x00ffffff)) = (b)) +#define writew(b,addr) (void)((*(volatile unsigned short *) \ + ((unsigned long)(addr) & 0x00ffffff)) = (b)) +#define writel(b,addr) (void)((*(volatile unsigned long *) \ + ((unsigned long)(addr) & 0x00ffffff)) = (b)) #define readb_relaxed(addr) readb(addr) #define readw_relaxed(addr) readw(addr) #define readl_relaxed(addr) readl(addr) -- Yoshinori Sato - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/