lkml.org 
[lkml]   [2005]   [Oct]   [15]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
Patch in this message
/
DateSat, 15 Oct 2005 16:59:47 +0900 (JST)
Subject[PATCH 2.6.14-rc4] m32r: NONCACHE_OFFSET in _port2addr
FromHirokazu Takata <>
Change _port2addr() not to add NONCACHE_OFFSET.
Adding NONCACHE_OFFSET requires needless address adjusting by a driver
using ioremap() like a SMC91x driver.

Signed-off-by: Hayato Fujiwara <fujiwara@linux-m32r.org>
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
---
Index: linux-2.6.14-rc3/arch/m32r/kernel/io_mappi.c
===================================================================
--- linux-2.6.14-rc3.orig/arch/m32r/kernel/io_mappi.c	2005-10-01 06:17:35.000000000 +0900
+++ linux-2.6.14-rc3/arch/m32r/kernel/io_mappi.c	2005-10-05 20:49:00.782707112 +0900
@@ -31,7 +31,7 @@
 
 static inline void *_port2addr(unsigned long port)
 {
-	return (void *)(port + NONCACHE_OFFSET);
+	return (void *)(port | (NONCACHE_OFFSET));
 }
 
 static inline void *_port2addr_ne(unsigned long port)
Index: linux-2.6.14-rc3/arch/m32r/kernel/io_mappi2.c
===================================================================
--- linux-2.6.14-rc3.orig/arch/m32r/kernel/io_mappi2.c	2005-10-01 06:17:35.000000000 +0900
+++ linux-2.6.14-rc3/arch/m32r/kernel/io_mappi2.c	2005-10-05 20:49:00.782707112 +0900
@@ -33,7 +33,7 @@
 
 static inline void *_port2addr(unsigned long port)
 {
-	return (void *)(port + NONCACHE_OFFSET);
+	return (void *)(port | (NONCACHE_OFFSET));
 }
 
 #define LAN_IOSTART	0x300
Index: linux-2.6.14-rc3/arch/m32r/kernel/io_opsput.c
===================================================================
--- linux-2.6.14-rc3.orig/arch/m32r/kernel/io_opsput.c	2005-10-01 06:17:35.000000000 +0900
+++ linux-2.6.14-rc3/arch/m32r/kernel/io_opsput.c	2005-10-05 20:49:00.783706960 +0900
@@ -36,7 +36,7 @@
 
 static inline void *_port2addr(unsigned long port)
 {
-	return (void *)(port + NONCACHE_OFFSET);
+	return (void *)(port | (NONCACHE_OFFSET));
 }
 
 /*
Index: linux-2.6.14-rc3/arch/m32r/kernel/io_usrv.c
===================================================================
--- linux-2.6.14-rc3.orig/arch/m32r/kernel/io_usrv.c	2005-10-01 06:17:35.000000000 +0900
+++ linux-2.6.14-rc3/arch/m32r/kernel/io_usrv.c	2005-10-05 20:49:00.783706960 +0900
@@ -47,7 +47,7 @@
 	else if (port >= UART1_IOSTART && port <= UART1_IOEND)
 		port = ((port - UART1_IOSTART) << 1) + UART1_REGSTART;
 #endif	/* CONFIG_SERIAL_8250 || CONFIG_SERIAL_8250_MODULE */
-	return (void *)(port + NONCACHE_OFFSET);
+	return (void *)(port | (NONCACHE_OFFSET));
 }
 
 static inline void delay(void)
Index: linux-2.6.14-rc3/arch/m32r/kernel/io_oaks32r.c
===================================================================
--- linux-2.6.14-rc3.orig/arch/m32r/kernel/io_oaks32r.c	2005-10-01 06:17:35.000000000 +0900
+++ linux-2.6.14-rc3/arch/m32r/kernel/io_oaks32r.c	2005-10-05 20:49:00.783706960 +0900
@@ -16,7 +16,7 @@
 
 static inline void *_port2addr(unsigned long port)
 {
-	return (void *)(port + NONCACHE_OFFSET);
+	return (void *)(port | (NONCACHE_OFFSET));
 }
 
 static inline  void *_port2addr_ne(unsigned long port)
--
Hirokazu Takata <takata@linux-m32r.org>
Linux/M32R Project:  http://www.linux-m32r.org/

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

\
 
 \ /
  Last update: 2005-10-15 06:03    [W:0.780 / U:0.080 seconds]
©2003-2008 Jasper Spaans