git: a7d876f70100 - main - vmm amdvi: Move ctrl under #ifdef AMDVI_DEBUG_CMD.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 08 Apr 2022 00:04:01 UTC
The branch main has been updated by jhb:

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

commit a7d876f7010068d93f1d9b4bb62d1370c9a0798f
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-08 00:01:29 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-08 00:01:29 +0000

    vmm amdvi: Move ctrl under #ifdef AMDVI_DEBUG_CMD.
---
 sys/amd64/vmm/amd/amdvi_hw.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/amd64/vmm/amd/amdvi_hw.c b/sys/amd64/vmm/amd/amdvi_hw.c
index 57386b6bea88..86df0ad76bf5 100644
--- a/sys/amd64/vmm/amd/amdvi_hw.c
+++ b/sys/amd64/vmm/amd/amdvi_hw.c
@@ -444,13 +444,14 @@ amdvi_inv_domain(struct amdvi_softc *softc, uint16_t domain_id)
 static	bool
 amdvi_cmp_wait(struct amdvi_softc *softc)
 {
-	struct amdvi_ctrl *ctrl;
+#ifdef AMDVI_DEBUG_CMD
+	struct amdvi_ctrl *ctrl = softc->ctrl;
+#endif
 	const uint64_t VERIFY = 0xA5A5;
 	volatile uint64_t *read;
 	int i;
 	bool status;
 
-	ctrl = softc->ctrl;
 	read = &softc->cmp_data;
 	*read = 0;
 	amdvi_cmd_cmp(softc, VERIFY);