Skip to contentSkip to conversation

x86: fix shadowed variable warning

PATCH In review Harvey Harrison 2 participants 2 messages Aug 9, 2008 – Aug 11, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: fix shadowed variable warning

arch/x86/kernel/pvclock.c:102:6: warning: symbol 'tsc_khz' shadows an earlier one include/asm/tsc.h:18:21: originally declared here

---
Introduced between next-20080729 and next-20080808

 arch/x86/kernel/pvclock.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
arch/x86/kernel/pvclock.c +5 -5
index 1c54b5f..4f9c55f 100644
@@ -99,14 +99,14 @@ static unsigned pvclock_get_time_values(struct pvclock_shadow_time *dst,
 
 unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src)
 {
-	u64 tsc_khz = 1000000ULL << 32;
+	u64 pv_tsc_khz = 1000000ULL << 32;
 
-	do_div(tsc_khz, src->tsc_to_system_mul);
+	do_div(pv_tsc_khz, src->tsc_to_system_mul);
 	if (src->tsc_shift < 0)
-		tsc_khz <<= -src->tsc_shift;
+		pv_tsc_khz <<= -src->tsc_shift;
 	else
-		tsc_khz >>= src->tsc_shift;
-	return tsc_khz;
+		pv_tsc_khz >>= src->tsc_shift;
+	return pv_tsc_khz;
 }
 
 cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
Signature · 1 line
1.6.0.rc1.278.g9c632
#1 lore raw
Quoted 9 lines · Harvey Harrison

arch/x86/kernel/pvclock.c:102:6: warning: symbol 'tsc_khz' shadows an earlier one include/asm/tsc.h:18:21: originally declared here

---
Introduced between next-20080729 and next-20080808

 arch/x86/kernel/pvclock.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

caused by this commit in the KVM tree:

commit ba03518948d9af809a44fc1ab43e9e8c1638abaa
Author: Glauber Costa <[email protected]>
Date: Mon Jul 28 11:47:52 2008 -0300

x86: paravirt: factor out cpu_khz to common code

KVM intends to use paravirt code to calibrate khz. Xen current code will do just fine. So as a first step, factor out code to pvclock.c.

Ingo