Skip to content

Commit

Permalink
[MIPS] Alchemy: fix off by two error in __fixup_bigphys_addr()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergei Shtylyov authored and Ralf Baechle committed Dec 14, 2007
1 parent dd99d96 commit b87bb40
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions arch/mips/au1000/common/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,11 @@ phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)

#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;
end = (u32)Au1500_PCI_MEM_END;
/* check for pci memory window */
if ((phys_addr >= start) && ((phys_addr + size) < end))
/* Check for PCI memory window */
if (phys_addr >= start && (phys_addr + size - 1) <= end)
return (phys_t)
((phys_addr - start) + Au1500_PCI_MEM_START);
}
Expand Down

0 comments on commit b87bb40

Please sign in to comment.