]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
CNS3xxx: Fix PCI cns3xxx_write_config()
authorKrzysztof Halasa <khalasa@piap.pl>
Fri, 11 Mar 2016 11:32:14 +0000 (12:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 May 2016 09:21:11 +0000 (11:21 +0200)
commit 88e9da9a2a70b6f1a171fbf30a681d6bc4031c4d upstream.

The "where" offset was added twice, fix it.

Signed-off-by: Krzysztof HaƂasa <khalasa@piap.pl>
Fixes: 498a92d42596 ("ARM: cns3xxx: pci: avoid potential stack overflow")
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mach-cns3xxx/pcie.c

index 47905a50e0757e94c1300ec98a3924d9a51b7a5b..318394ed5c7a97c2923c8c35134b88cb188ef238 100644 (file)
@@ -220,13 +220,13 @@ static void cns3xxx_write_config(struct cns3xxx_pcie *cnspci,
        u32 mask = (0x1ull << (size * 8)) - 1;
        int shift = (where % 4) * 8;
 
-       v = readl_relaxed(base + (where & 0xffc));
+       v = readl_relaxed(base);
 
        v &= ~(mask << shift);
        v |= (val & mask) << shift;
 
-       writel_relaxed(v, base + (where & 0xffc));
-       readl_relaxed(base + (where & 0xffc));
+       writel_relaxed(v, base);
+       readl_relaxed(base);
 }
 
 static void __init cns3xxx_pcie_hw_init(struct cns3xxx_pcie *cnspci)