git: 0bf049af5a8b - stable/13 - vmm: Re-quiet set but unused warnings.

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

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

commit 0bf049af5a8be17a25c029622bd81791ba2157f5
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-08 00:01:29 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-01-26 19:26:25 +0000

    vmm: Re-quiet set but unused warnings.
    
    __diagused is no longer used for KTR, so instead use #ifdef KTR or
    expand KTR-only variables into their values in traces.
    
    (cherry picked from commit 572edd3dae9fc3e67dfb1cb9ba023e8d3fe2a9bb)
---
 sys/amd64/vmm/io/vrtc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sys/amd64/vmm/io/vrtc.c b/sys/amd64/vmm/io/vrtc.c
index dd32b279cf03..10bab96700e4 100644
--- a/sys/amd64/vmm/io/vrtc.c
+++ b/sys/amd64/vmm/io/vrtc.c
@@ -285,12 +285,13 @@ rtc_to_secs(struct vrtc *vrtc)
 	struct clocktime ct;
 	struct timespec ts;
 	struct rtcdev *rtc;
-	struct vm *vm __diagused;
+#ifdef KTR
+	struct vm *vm = vtrc->vm;
+#endif
 	int century, error, hour, pm, year;
 
 	KASSERT(VRTC_LOCKED(vrtc), ("%s: vrtc not locked", __func__));
 
-	vm = vrtc->vm;
 	rtc = &vrtc->rtcdev;
 
 	bzero(&ct, sizeof(struct clocktime));
@@ -401,7 +402,6 @@ static int
 vrtc_time_update(struct vrtc *vrtc, time_t newtime, sbintime_t newbase)
 {
 	struct rtcdev *rtc;
-	sbintime_t oldbase __diagused;
 	time_t oldtime;
 	uint8_t alarm_sec, alarm_min, alarm_hour;
 
@@ -416,9 +416,8 @@ vrtc_time_update(struct vrtc *vrtc, time_t newtime, sbintime_t newbase)
 	VM_CTR2(vrtc->vm, "Updating RTC secs from %#lx to %#lx",
 	    oldtime, newtime);
 
-	oldbase = vrtc->base_uptime;
 	VM_CTR2(vrtc->vm, "Updating RTC base uptime from %#lx to %#lx",
-	    oldbase, newbase);
+	    vrtc->base_uptime, newbase);
 	vrtc->base_uptime = newbase;
 
 	if (newtime == oldtime)