diff options
author | Qi Liu <liuqi115@huawei.com> | 2021-04-01 19:16:41 +0800 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2021-04-01 18:05:32 +0100 |
commit | 2c2e21e78a945b174629944281997bbcb839e6bb (patch) | |
tree | 96694d3a88140edf86d0bcb58a40c76ef5bf2082 /arch/arm64/kernel/perf_event.c | |
parent | e20ac6c54a93335b56a6d057aa5da27183f573fa (diff) | |
download | linux-stable-2c2e21e78a945b174629944281997bbcb839e6bb.tar.gz linux-stable-2c2e21e78a945b174629944281997bbcb839e6bb.tar.bz2 linux-stable-2c2e21e78a945b174629944281997bbcb839e6bb.zip |
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: Qi Liu <liuqi115@huawei.com>
Link: https://lore.kernel.org/r/1617275801-1980-1-git-send-email-liuqi115@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/perf_event.c')
-rw-r--r-- | arch/arm64/kernel/perf_event.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 4658fcf88c2b..f594957e29bd 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -470,9 +470,8 @@ static inline u64 armv8pmu_read_evcntr(int idx) static inline u64 armv8pmu_read_hw_counter(struct perf_event *event) { 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)) val = (val << 32) | armv8pmu_read_evcntr(idx - 1); return val; @@ -520,7 +519,7 @@ static u64 armv8pmu_read_counter(struct perf_event *event) { struct hw_perf_event *hwc = &event->hw; int idx = hwc->idx; - u64 value = 0; + u64 value; if (idx == ARMV8_IDX_CYCLE_COUNTER) value = read_sysreg(pmccntr_el0); |