git: 2174f0f2f253 - main - net/route: Use __diagused for variables only used in KASSERT().

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 13 Apr 2022 23:09:10 UTC
The branch main has been updated by jhb:

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

commit 2174f0f2f25310308f92743da849fee32c65db8a
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-13 23:08:19 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-13 23:08:19 +0000

    net/route: Use __diagused for variables only used in KASSERT().
---
 sys/net/route/nhgrp_ctl.c | 2 +-
 sys/net/route/nhop_ctl.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c
index 6a3f853e073d..fc9e67c21fe9 100644
--- a/sys/net/route/nhgrp_ctl.c
+++ b/sys/net/route/nhgrp_ctl.c
@@ -295,7 +295,7 @@ void
 nhgrp_ref_object(struct nhgrp_object *nhg)
 {
 	struct nhgrp_priv *nhg_priv;
-	u_int old;
+	u_int old __diagused;
 
 	nhg_priv = NHGRP_PRIV(nhg);
 	old = refcount_acquire(&nhg_priv->nhg_refcount);
diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c
index 6a82391307f1..785244e5e964 100644
--- a/sys/net/route/nhop_ctl.c
+++ b/sys/net/route/nhop_ctl.c
@@ -631,7 +631,7 @@ destroy_nhop_epoch(epoch_context_t ctx)
 void
 nhop_ref_object(struct nhop_object *nh)
 {
-	u_int old;
+	u_int old __diagused;
 
 	old = refcount_acquire(&nh->nh_priv->nh_refcnt);
 	KASSERT(old > 0, ("%s: nhop object %p has 0 refs", __func__, nh));