CHROMIUM: arm: exynos: fix math in ppmu driver
authorOlof Johansson <olofj@chromium.org>
Thu, 15 Nov 2012 17:10:36 +0000 (09:10 -0800)
committerGerrit <chrome-bot@google.com>
Fri, 16 Nov 2012 01:51:09 +0000 (17:51 -0800)
The define doesn't wrap the argument properly so the math ends up wrong.

BUG=chromium-os:36402
TEST=check /proc/cpu/alignment and "perf top -G --symbols do_alignment_ldrstr" after applying

Change-Id: Ifd342de96c682bc2a2acaf7a9bfb73f0d5d2f516
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38123
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
arch/arm/mach-exynos/include/mach/ppmu.h

index e224666..1519063 100644 (file)
@@ -38,8 +38,8 @@
 #define MAX_CCNT               100
 #define RDWR_DATA_COUNT                0x7
 
-#define PMCNT_OFFSET(i)                (PPMU_PMCNT0 + (PPMU_PMCNT_OFFSET * i))
-#define PPMU_BEVTSEL(i)                (PPMU_BEVT0SEL + (PPMU_BEVTSEL_OFFSET * i))
+#define PMCNT_OFFSET(i)                (PPMU_PMCNT0 + (PPMU_PMCNT_OFFSET * (i)))
+#define PPMU_BEVTSEL(i)                (PPMU_BEVT0SEL + (PPMU_BEVTSEL_OFFSET * (i)))
 
 enum ppmu_type {
        PPMU_MIF,