Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b87bb40b62310328e908d580e013e0575b05886c
Commit:     b87bb40b62310328e908d580e013e0575b05886c
Parent:     dd99d9661c72fe251b842705f2e7cfaa4918a13c
Author:     Sergei Shtylyov <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 10 20:36:50 2007 +0300
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Dec 14 17:34:29 2007 +0000

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 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 a90d425..d885e38 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)
 
 #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);
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to