Commit 2c2e21e7 authored by Qi Liu's avatar Qi Liu Committed by Will Deacon

arm64: perf: Remove redundant initialization in perf_event.c

The initialization of value in function armv8pmu_read_hw_counter()
and armv8pmu_read_counter() seem redundant, as they are soon updated.
So, We can remove them.
Signed-off-by: default avatarQi Liu <liuqi115@huawei.com>
Link: https://lore.kernel.org/r/1617275801-1980-1-git-send-email-liuqi115@huawei.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent e20ac6c5
...@@ -470,9 +470,8 @@ static inline u64 armv8pmu_read_evcntr(int idx) ...@@ -470,9 +470,8 @@ static inline u64 armv8pmu_read_evcntr(int idx)
static inline u64 armv8pmu_read_hw_counter(struct perf_event *event) static inline u64 armv8pmu_read_hw_counter(struct perf_event *event)
{ {
int idx = event->hw.idx; int idx = event->hw.idx;
u64 val = 0; u64 val = armv8pmu_read_evcntr(idx);
val = armv8pmu_read_evcntr(idx);
if (armv8pmu_event_is_chained(event)) if (armv8pmu_event_is_chained(event))
val = (val << 32) | armv8pmu_read_evcntr(idx - 1); val = (val << 32) | armv8pmu_read_evcntr(idx - 1);
return val; return val;
...@@ -520,7 +519,7 @@ static u64 armv8pmu_read_counter(struct perf_event *event) ...@@ -520,7 +519,7 @@ static u64 armv8pmu_read_counter(struct perf_event *event)
{ {
struct hw_perf_event *hwc = &event->hw; struct hw_perf_event *hwc = &event->hw;
int idx = hwc->idx; int idx = hwc->idx;
u64 value = 0; u64 value;
if (idx == ARMV8_IDX_CYCLE_COUNTER) if (idx == ARMV8_IDX_CYCLE_COUNTER)
value = read_sysreg(pmccntr_el0); value = read_sysreg(pmccntr_el0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment