public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] H8/300 read{b,w,l} / write{b,w,l} error fix
@ 2004-11-12 16:42 Yoshinori Sato
       [not found] ` <1100280300.27149.8.camel@localhost.localdomain>
  0 siblings, 1 reply; 2+ messages in thread
From: Yoshinori Sato @ 2004-11-12 16:42 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

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
<ysato@users.sourceforge.jp>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-13 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-12 16:42 [PATCH] H8/300 read{b,w,l} / write{b,w,l} error fix Yoshinori Sato
     [not found] ` <1100280300.27149.8.camel@localhost.localdomain>
2004-11-13 15:26   ` Yoshinori Sato

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox