Skip to contentSkip to conversation

arm64: perf: Remove redundant initialization in perf_event.c

PATCH Applied Qi Liu 2 participants 2 messages Apr 1, 2021

Subsystems (3)
lore
Share & tools
lore

Qi Liu

author
#0 lore raw

PATCH 1/1 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.

---
 arch/arm64/kernel/perf_event.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/arm64/kernel/perf_event.c +2 -3
index 4658fcf..f594957 100644
@@ -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);
Signature · 7 lines
2.8.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Applied
#1 lore raw
Quoted 3 lines · Qi Liu

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.

Applied to will (for-next/perf), thanks!

[1/1] arm64: perf: Remove redundant initialization in perf_event.c

      https://git.kernel.org/will/c/2c2e21e78a94

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel