Skip to contentSkip to conversation

x86: kvm: x86: Remove unnecessary initial values of variables

PATCH Applied Li zeming 2 participants 2 messages Aug 15, 2023 – Aug 18, 2023

Subsystems (3)
lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 x86: kvm: x86: Remove unnecessary initial values of variables

bitmap and khz is assigned first, so it does not need to initialize the assignment.

---
 arch/x86/kvm/x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/x86.c +2 -2
index 278dbd37dab2..62715bb4754d 100644
@@ -6529,7 +6529,7 @@ static void kvm_free_msr_filter(struct kvm_x86_msr_filter *msr_filter)
 static int kvm_add_msr_filter(struct kvm_x86_msr_filter *msr_filter,
 			      struct kvm_msr_filter_range *user_range)
 {
-	unsigned long *bitmap = NULL;
+	unsigned long *bitmap;
 	size_t bitmap_size;
 
 	if (!user_range->nmsrs)
@@ -9169,7 +9169,7 @@ static int kvmclock_cpu_down_prep(unsigned int cpu)
 static void tsc_khz_changed(void *data)
 {
 	struct cpufreq_freqs *freq = data;
-	unsigned long khz = 0;
+	unsigned long khz;
 
 	WARN_ON_ONCE(boot_cpu_has(X86_FEATURE_CONSTANT_TSC));
 
Signature · 1 line
2.18.2