diff options
author | John Garry <john.garry@huawei.com> | 2021-10-01 13:48:45 +0300 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2021-10-04 15:13:11 +0300 |
commit | 78cac393b4642eb5936d9c0685acd50d8370648f (patch) | |
tree | be24ec37efe071baaff2183aeda927eed36be1e1 /drivers/perf/thunderx2_pmu.c | |
parent | 16cc4af286aae85859ee39e25d21f3d910f8175d (diff) | |
download | linux-78cac393b4642eb5936d9c0685acd50d8370648f.tar.xz |
drivers/perf: thunderx2_pmu: Change data in size tx2_uncore_event_update()
A LSL of 32 requires > 32b value to hold the result. However in
tx2_uncore_event_update(), 1UL << 32 currently only works as unsigned
long is 64b on a 64b system.
If we want to compile test for a 32b system, we need unsigned long long,
whose min size is 64b.
Signed-off-by: John Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/1633085326-156653-2-git-send-email-john.garry@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/perf/thunderx2_pmu.c')
-rw-r--r-- | drivers/perf/thunderx2_pmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/perf/thunderx2_pmu.c b/drivers/perf/thunderx2_pmu.c index fc1a376ee906..05378c0fd8f3 100644 --- a/drivers/perf/thunderx2_pmu.c +++ b/drivers/perf/thunderx2_pmu.c @@ -487,7 +487,7 @@ static void tx2_uncore_event_update(struct perf_event *event) new = reg_readl(hwc->event_base); prev = local64_xchg(&hwc->prev_count, new); /* handles rollover of 32 bit counter */ - delta = (u32)(((1UL << 32) - prev) + new); + delta = (u32)(((1ULL << 32) - prev) + new); } /* DMC event data_transfers granularity is 16 Bytes, convert it to 64 */ |