[PATCH 2.6.14-rc4] m32r: NONCACHE_OFFSET in _port2addr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
Signed-off-by: Hirokazu Takata <[email protected]>
---

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 <[email protected]>
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux