Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2022 18:47:46 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: be93526576ce - stable/13 - Fix unused variable warning in netipsec's key_debug.c
Message-ID:  <202207291847.26TIlkn6024549@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dim:

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

commit be93526576ceb4bbb9511738dd7b6d95d69a71a1
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:31:13 +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 4f03d78d434f..04946dc5c165 100644
--- a/sys/netipsec/key_debug.c
+++ b/sys/netipsec/key_debug.c
@@ -916,9 +916,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++) {
@@ -927,7 +927,6 @@ kdebug_mbuf(const struct mbuf *m0)
 			if (i % 4 == 0)
 				printf(" ");
 			printf("%02x", mtod(m, const u_char *)[i]);
-			j++;
 		}
 		printf("\n");
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207291847.26TIlkn6024549>