git: c01fdd7a9f31 - main - Fix unused variable warning in netipsec's key_debug.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 26 Jul 2022 19:25:25 UTC
The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c01fdd7a9f316c8c04786441ca0113be002b96be commit c01fdd7a9f316c8c04786441ca0113be002b96be Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2022-07-26 19:21:44 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2022-07-26 19:25:09 +0000 Fix unused variable warning in netipsec's key_debug.c With clang 15, the following -Werror warning is produced: sys/netipsec/key_debug.c:923:9: error: variable 'j' set but not used [-Werror,-Wunused-but-set-variable] int i, j; ^ The 'j' variable was in key_debug.c when it was first added, but it appears to have been a debugging aid that has never been used, so remove it. MFC after: 3 days --- sys/netipsec/key_debug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netipsec/key_debug.c b/sys/netipsec/key_debug.c index 58f2d2b614c5..3705879397ff 100644 --- a/sys/netipsec/key_debug.c +++ b/sys/netipsec/key_debug.c @@ -920,9 +920,9 @@ void kdebug_mbuf(const struct mbuf *m0) { const struct mbuf *m = m0; - int i, j; + int i; - for (j = 0; m; m = m->m_next) { + for (; m; m = m->m_next) { kdebug_mbufhdr(m); printf(" m_data:\n"); for (i = 0; i < m->m_len; i++) { @@ -931,7 +931,6 @@ kdebug_mbuf(const struct mbuf *m0) if (i % 4 == 0) printf(" "); printf("%02x", mtod(m, const u_char *)[i]); - j++; } printf("\n"); }