mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
[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>
This commit is contained in:
parent
dd99d9661c
commit
b87bb40b62
@ -137,12 +137,11 @@ phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
|
|||||||
|
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
{
|
{
|
||||||
u32 start, end;
|
u32 start = (u32)Au1500_PCI_MEM_START;
|
||||||
|
u32 end = (u32)Au1500_PCI_MEM_END;
|
||||||
|
|
||||||
start = (u32)Au1500_PCI_MEM_START;
|
/* Check for PCI memory window */
|
||||||
end = (u32)Au1500_PCI_MEM_END;
|
if (phys_addr >= start && (phys_addr + size - 1) <= end)
|
||||||
/* check for pci memory window */
|
|
||||||
if ((phys_addr >= start) && ((phys_addr + size) < end))
|
|
||||||
return (phys_t)
|
return (phys_t)
|
||||||
((phys_addr - start) + Au1500_PCI_MEM_START);
|
((phys_addr - start) + Au1500_PCI_MEM_START);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user