[1/2] KVM: VMX: Drop unprotected-by-braces variable declaration in case-statement

Message ID 20230315191128.1407655-2-seanjc@google.com
State New
Headers
Series KVM: x86: Fix kvm/queue breakage on clang |

Commit Message

Sean Christopherson March 15, 2023, 7:11 p.m. UTC
  Remove the intermediate "guest_flush_l1d" boolean to fix a build error on
clang due to the variable being declared inside a case-statement without
curly braces to create a proper code block.

Fixes: c7ed946b95cb ("kvm: vmx: Add IA32_FLUSH_CMD guest support")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202303151912.oZ6SGd90-lkp@intel.com
Cc: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kvm/vmx/vmx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Patch

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index c63f6c786eb1..d7bf14abdba1 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2325,10 +2325,8 @@  static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 					   X86_FEATURE_IBPB);
 		break;
 	case MSR_IA32_FLUSH_CMD:
-		bool guest_flush_l1d = guest_cpuid_has(vcpu,
-						       X86_FEATURE_FLUSH_L1D);
 		ret = vmx_set_msr_ia32_cmd(vcpu, msr_info,
-					   guest_flush_l1d,
+					   guest_cpuid_has(vcpu, X86_FEATURE_FLUSH_L1D),
 					   L1D_FLUSH,
 					   X86_FEATURE_FLUSH_L1D);
 		break;