Skip to contentSkip to conversation

eliminate-the-compile-warning for perf_event.c

PATCH New Lidong Chen 1 participant 2 messages Apr 14, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eliminate-the-compile-warning for perf_event.c

From: Lidong Chen <[email protected]>

arch/x86/kernel/cpu/perf_event.c: In function ‘check_hw_exists’:
arch/x86/kernel/cpu/perf_event.c:190: warning: ‘val_fail’ may be used uninitialized in this function arch/x86/kernel/cpu/perf_event.c:191: warning: ‘reg_fail’ may be used uninitialized in this function

Lidong Chen (1):
eliminate the compile warning

 arch/x86/kernel/cpu/perf_event.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.4.0-rc1
#1 lore raw

PATCH 1/1 eliminate the compile warning

---
 arch/x86/kernel/cpu/perf_event.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/perf_event.c +3 -2
index b71a7f8..40be9af 100644
@@ -187,9 +187,10 @@ static void release_pmc_hardware(void) {}
 
 static bool check_hw_exists(void)
 {
-	u64 val, val_fail, val_new= ~0;
-	int i, reg, reg_fail, ret = 0;
+	u64 val = 0, val_fail = 0, val_new = ~0;
+	int reg = 0, reg_fail = 0, ret = 0;
 	int bios_fail = 0;
+	int i = 0;
 
 	/*
 	 * Check to see if the BIOS enabled any of the counters, if so
Signature · 1 line
2.4.0-rc1