net/route: Use __diagused for variables only used in KASSERT().

This commit is contained in:
John Baldwin 2022-04-13 16:08:19 -07:00
parent b25ddb782f
commit 2174f0f2f2
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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));