]> git.hungrycats.org Git - linux/commitdiff
[ARM] Fix VMALLOC range check in IXP4xx I/O routines
authorRobert Daniels <robertd@vantagecontrols.com>
Tue, 31 Aug 2004 05:16:13 +0000 (22:16 -0700)
committerDeepak Saxena <dsaxena@plexity.net>
Tue, 31 Aug 2004 05:16:13 +0000 (22:16 -0700)
I found a problem in the implementation of io.h for the ixp425.
It wasn't letting me access memory at VMALLOC_START, only after it.
I've included a patch to fix this problem.  This patch is for the
2.4.x kernel, but it looks like it needs fixing in the 2.6.x kernel as
well.

Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
include/asm-arm/arch-ixp4xx/io.h

index 91d25c25d6b7977734b411cade59209aaee70474..5400ab0ba5f0908bf2ad468c2e96c7b33f263be2 100644 (file)
@@ -73,7 +73,7 @@ __ixp4xx_iounmap(void *addr)
 {
        extern void __iounmap(void *addr);
 
-       if ((u32)addr > VMALLOC_START)
+       if ((u32)addr >= VMALLOC_START)
                __iounmap(addr);
 }
 
@@ -101,7 +101,7 @@ __ixp4xx_writeb(u8 value, u32 addr)
 {
        u32 n, byte_enables, data;
 
-       if (addr > VMALLOC_START) {
+       if (addr >= VMALLOC_START) {
                __raw_writeb(value, addr);
                return;
        }
@@ -124,7 +124,7 @@ __ixp4xx_writew(u16 value, u32 addr)
 {
        u32 n, byte_enables, data;
 
-       if (addr > VMALLOC_START) {
+       if (addr >= VMALLOC_START) {
                __raw_writew(value, addr);
                return;
        }
@@ -145,7 +145,7 @@ __ixp4xx_writesw(u32 bus_addr, u16 *vaddr, int count)
 static inline void 
 __ixp4xx_writel(u32 value, u32 addr)
 {
-       if (addr > VMALLOC_START) {
+       if (addr >= VMALLOC_START) {
                __raw_writel(value, addr);
                return;
        }
@@ -165,7 +165,7 @@ __ixp4xx_readb(u32 addr)
 {
        u32 n, byte_enables, data;
 
-       if (addr > VMALLOC_START)
+       if (addr >= VMALLOC_START)
                return __raw_readb(addr);
 
        n = addr % 4;
@@ -188,7 +188,7 @@ __ixp4xx_readw(u32 addr)
 {
        u32 n, byte_enables, data;
 
-       if (addr > VMALLOC_START)
+       if (addr >= VMALLOC_START)
                return __raw_readw(addr);
 
        n = addr % 4;
@@ -211,7 +211,7 @@ __ixp4xx_readl(u32 addr)
 {
        u32 data;
 
-       if (addr > VMALLOC_START)
+       if (addr >= VMALLOC_START)
                return __raw_readl(addr);
 
        if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data))