[PATCH 2.6.14-rc4] m32r: NONCACHE_OFFSET in _port2addr

From: Hirokazu Takata
Date: Sat Oct 15 2005 - 03:00:43 EST


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@xxxxxxxxxxxxxx>
Signed-off-by: Hirokazu Takata <takata@xxxxxxxxxxxxxx>
---

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@xxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/