From df5d2841d507589af0de7301f6cee3d2b98a35be Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 21 Jul 2022 22:03:50 +0200 Subject: [PATCH] Fix unused variable warning in ipsec_mbuf.c With clang 15, the following -Werror warning is produced: sys/netipsec/ipsec_mbuf.c:93:24: error: variable 'alloc' set but not used [-Werror,-Wunused-but-set-variable] int todo, len, done, alloc; ^ The 'alloc' variable appears to have been a debugging aid that has never been used for anything, so remove it. MFC after: 3 days --- sys/netipsec/ipsec_mbuf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/netipsec/ipsec_mbuf.c b/sys/netipsec/ipsec_mbuf.c index 170728f91bd..75aa8cae5a3 100644 --- a/sys/netipsec/ipsec_mbuf.c +++ b/sys/netipsec/ipsec_mbuf.c @@ -90,11 +90,10 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off) *off = skip; } else if (hlen > M_TRAILINGSPACE(m)) { struct mbuf *n0, *n, **np; - int todo, len, done, alloc; + int todo, len, done; n0 = NULL; np = &n0; - alloc = 0; done = 0; todo = remain; while (todo > 0) { @@ -112,7 +111,6 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off) } *np = n; np = &n->m_next; - alloc++; len = min(todo, len); memcpy(n->m_data, mtod(m, char *) + skip + done, len); n->m_len = len; @@ -134,7 +132,6 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off) m_freem(n0); return NULL; } - alloc++; if ((n->m_next = n0) == NULL) np = &n->m_next;