git: 350f14da553a - stable/13 - vmm: fix set but not used warnings

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 26 Jan 2023 19:28:43 UTC
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=350f14da553af6a7441f38d8256092a1e3f776a4

commit 350f14da553af6a7441f38d8256092a1e3f776a4
Author:     Robert Wing <rew@FreeBSD.org>
AuthorDate: 2022-04-10 18:30:11 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-01-26 19:26:51 +0000

    vmm: fix set but not used warnings
    
    (cherry picked from commit 5c272efaba291f744191dca86f04418bfe90b222)
---
 sys/amd64/vmm/intel/vmx.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index d88abbc62342..857028dcd0f1 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -1403,7 +1403,7 @@ vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset)
 static void
 vmx_inject_nmi(struct vmx *vmx, int vcpu)
 {
-	uint32_t gi, info;
+	uint32_t gi __diagused, info;
 
 	gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY);
 	KASSERT((gi & NMI_BLOCKING) == 0, ("vmx_inject_nmi: invalid guest "
@@ -1648,7 +1648,7 @@ vmx_clear_nmi_blocking(struct vmx *vmx, int vcpuid)
 static void
 vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid)
 {
-	uint32_t gi;
+	uint32_t gi __diagused;
 
 	gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY);
 	KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING,
@@ -1972,7 +1972,7 @@ static uint64_t
 inout_str_index(struct vmx *vmx, int vcpuid, int in)
 {
 	uint64_t val;
-	int error;
+	int error __diagused;
 	enum vm_reg_name reg;
 
 	reg = in ? VM_REG_GUEST_RDI : VM_REG_GUEST_RSI;
@@ -1985,7 +1985,7 @@ static uint64_t
 inout_str_count(struct vmx *vmx, int vcpuid, int rep)
 {
 	uint64_t val;
-	int error;
+	int error __diagused;
 
 	if (rep) {
 		error = vmx_getreg(vmx, vcpuid, VM_REG_GUEST_RCX, &val);
@@ -2018,7 +2018,7 @@ static void
 inout_str_seginfo(struct vmx *vmx, int vcpuid, uint32_t inst_info, int in,
     struct vm_inout_str *vis)
 {
-	int error, s;
+	int error __diagused, s;
 
 	if (in) {
 		vis->seg_name = VM_REG_GUEST_ES;
@@ -3884,7 +3884,7 @@ vmx_enable_x2apic_mode_vid(struct vlapic *vlapic)
 	struct vmx *vmx;
 	struct vmcs *vmcs;
 	uint32_t proc_ctls2;
-	int vcpuid, error;
+	int vcpuid, error __diagused;
 
 	vcpuid = vlapic->vcpuid;
 	vmx = ((struct vlapic_vtx *)vlapic)->vmx;