git: 1cb6fa98d8e2 - stable/12 - Fix unused variable warning in netipsec's key_debug.c

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Fri, 29 Jul 2022 18:48:50 UTC
The branch stable/12 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=1cb6fa98d8e2bdf719b1a7fc87091391a7282e40

commit 1cb6fa98d8e2bdf719b1a7fc87091391a7282e40
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-26 19:21:44 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-29 18:45:14 +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
    
    (cherry picked from commit c01fdd7a9f316c8c04786441ca0113be002b96be)
---
 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 3041d6368755..51fc510bc588 100644
--- a/sys/netipsec/key_debug.c
+++ b/sys/netipsec/key_debug.c
@@ -917,9 +917,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++) {
@@ -928,7 +928,6 @@ kdebug_mbuf(const struct mbuf *m0)
 			if (i % 4 == 0)
 				printf(" ");
 			printf("%02x", mtod(m, const u_char *)[i]);
-			j++;
 		}
 		printf("\n");
 	}