x86/perf/amd: remove set but not used variable 'active'
diff mbox series

Message ID 20191026120813.5534-1-wanghai38@huawei.com
State New
Headers show
Series
  • x86/perf/amd: remove set but not used variable 'active'
Related show

Commit Message

Wang Hai Oct. 26, 2019, 12:08 p.m. UTC
Fix the following gcc warning:

arch/x86/events/amd/core.c: In function amd_pmu_handle_irq:
arch/x86/events/amd/core.c:656:6: warning: variable active set but not
used [-Wunused-but-set-variable]

Fixes: df4d29732fda ("perf/x86/amd: Change/fix NMI latency mitigation to use a timestamp")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
---
 arch/x86/events/amd/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c
index 64c3e70..b7f2bfb 100644
--- a/arch/x86/events/amd/core.c
+++ b/arch/x86/events/amd/core.c
@@ -653,14 +653,14 @@  static void amd_pmu_disable_event(struct perf_event *event)
 static int amd_pmu_handle_irq(struct pt_regs *regs)
 {
 	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
-	int active, handled;
+	int handled;
 
 	/*
 	 * Obtain the active count before calling x86_pmu_handle_irq() since
 	 * it is possible that x86_pmu_handle_irq() may make a counter
 	 * inactive (through x86_pmu_stop).
 	 */
-	active = __bitmap_weight(cpuc->active_mask, X86_PMC_IDX_MAX);
+	__bitmap_weight(cpuc->active_mask, X86_PMC_IDX_MAX);
 
 	/* Process any counter overflows */
 	handled = x86_pmu_handle_irq(regs);