diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2007-12-10 12:36:50 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-12-14 12:34:29 -0500 |
commit | b87bb40b62310328e908d580e013e0575b05886c (patch) | |
tree | aa095d0a19180ff62a8cfa879e20c8cf5fe6f937 | |
parent | dd99d9661c72fe251b842705f2e7cfaa4918a13c (diff) |
[MIPS] Alchemy: fix off by two error in __fixup_bigphys_addr()
the PCI specific code in this function doesn't check for the address range
being under the upper bound of the PCI memory window correctly -- fix this,
somewhat beautifying the code around the check, while at it...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/au1000/common/setup.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c index a90d425d4651..d885e3848ec6 100644 --- a/arch/mips/au1000/common/setup.c +++ b/arch/mips/au1000/common/setup.c | |||
@@ -137,12 +137,11 @@ phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size) | |||
137 | 137 | ||
138 | #ifdef CONFIG_PCI | 138 | #ifdef CONFIG_PCI |
139 | { | 139 | { |
140 | u32 start, end; | 140 | u32 start = (u32)Au1500_PCI_MEM_START; |
141 | u32 end = (u32)Au1500_PCI_MEM_END; | ||
141 | 142 | ||
142 | start = (u32)Au1500_PCI_MEM_START; | 143 | /* Check for PCI memory window */ |
143 | end = (u32)Au1500_PCI_MEM_END; | 144 | if (phys_addr >= start && (phys_addr + size - 1) <= end) |
144 | /* check for pci memory window */ | ||
145 | if ((phys_addr >= start) && ((phys_addr + size) < end)) | ||
146 | return (phys_t) | 145 | return (phys_t) |
147 | ((phys_addr - start) + Au1500_PCI_MEM_START); | 146 | ((phys_addr - start) + Au1500_PCI_MEM_START); |
148 | } | 147 | } |