KVM: x86: Fix fall-through warnings for Clang
PATCH 1/1 KVM: x86: Fix fall-through warnings for Clang
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding break statements instead of just letting the code fall through to the next case.
---
JFYI: We had thousands of these sorts of warnings and now we are down
to just 25 in linux-next. These are some of those last remaining warnings.
arch/x86/kvm/cpuid.c | 1 + arch/x86/kvm/vmx/vmx.c | 1 + 2 files changed, 2 insertions(+)
arch/x86/kvm/cpuid.c +1 -0
@@ -655,6 +655,7 @@ static int __do_cpuid_func_emulated(struct kvm_cpuid_array *array, u32 func)if (kvm_cpu_cap_has (X86_FEATURE_RDTSCP )) entry->ecx =F (RDPID ); ++array->nent; +break ;default :break ; }
arch/x86/kvm/vmx/vmx.c +1 -0
@@ -6248,6 +6248,7 @@ void vmx_set_virtual_apic_mode(struct kvm_vcpu *vcpu)switch (kvm_get_apic_mode (vcpu)) {case LAPIC_MODE_INVALID :WARN_ONCE (true,"Invalid local APIC state" ); +break ;case LAPIC_MODE_DISABLED :break ;case LAPIC_MODE_XAPIC :
Signature · 1 line
2.27.0
Quoted 33 lines · Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding break statements instead of just letting the code fall through to the next case.
---
JFYI: We had thousands of these sorts of warnings and now we are down
to just 25 in linux-next. These are some of those last remaining warnings.arch/x86/kvm/cpuid.c | 1 + arch/x86/kvm/vmx/vmx.c | 1 + 2 files changed, 2 insertions(+)arch/x86/kvm/cpuid.c +1
-0@@ -655,6 +655,7 @@ static int __do_cpuid_func_emulated(struct kvm_cpuid_array *array, u32 func)if (kvm_cpu_cap_has (X86_FEATURE_RDTSCP )) entry->ecx =F (RDPID ); ++array->nent; +break ;default :break ; }arch/x86/kvm/vmx/vmx.c +0
-0
arch/x86/kvm/vmx/vmx.c void vmx_set_virtual_apic_mode(struct kvm_vcpu *vcpu) · line 6254
Quoted 7 lines
arch/x86/kvm/vmx/vmx.c +1
-0@@ -6248,6 +6248,7 @@ void vmx_set_virtual_apic_mode(struct kvm_vcpu *vcpu)switch (kvm_get_apic_mode (vcpu)) {case LAPIC_MODE_INVALID :WARN_ONCE (true,"Invalid local APIC state" ); +break ;case LAPIC_MODE_DISABLED :break ;case LAPIC_MODE_XAPIC :
Queued, thanks.
Paolo