public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Emanuele Giuseppe Esposito <eesposit@redhat.com>
Subject: [PATCH 1/2] KVM: VMX: Drop unprotected-by-braces variable declaration in case-statement
Date: Wed, 15 Mar 2023 12:11:27 -0700	[thread overview]
Message-ID: <20230315191128.1407655-2-seanjc@google.com> (raw)
In-Reply-To: <20230315191128.1407655-1-seanjc@google.com>

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(-)

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;
-- 
2.40.0.rc2.332.ga46443480c-goog


  reply	other threads:[~2023-03-15 19:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 19:11 [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Sean Christopherson
2023-03-15 19:11 ` Sean Christopherson [this message]
2023-03-15 19:11 ` [PATCH 2/2] KVM: SVM: Drop unprotected-by-braces variable declaration in case-statement Sean Christopherson
2023-03-16 12:07 ` [PATCH 0/2] KVM: x86: Fix kvm/queue breakage on clang Emanuele Giuseppe Esposito
2023-03-16 14:26 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230315191128.1407655-2-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=eesposit@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox