summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-cns3xxx
diff options
context:
space:
mode:
authorKrzysztof Halasa <khalasa@piap.pl>2016-03-11 12:32:14 +0100
committerOlof Johansson <olof@lixom.net>2016-03-12 17:02:06 -0800
commit88e9da9a2a70b6f1a171fbf30a681d6bc4031c4d (patch)
tree394c01cc59e098786fc17f0d57eb622e6d1e2116 /arch/arm/mach-cns3xxx
parent3cf2efd5d767ab652cfc1f94b918ddc05686500f (diff)
downloadlinux-88e9da9a2a70b6f1a171fbf30a681d6bc4031c4d.tar.bz2
CNS3xxx: Fix PCI cns3xxx_write_config()
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>
Diffstat (limited to 'arch/arm/mach-cns3xxx')
-rw-r--r--arch/arm/mach-cns3xxx/pcie.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c
index 47905a50e075..318394ed5c7a 100644
--- a/arch/arm/mach-cns3xxx/pcie.c
+++ b/arch/arm/mach-cns3xxx/pcie.c
@@ -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)