Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2022 18:48:16 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: c456a060ecc5 - stable/12 - Fix unused variable warning in if_pfsync.c
Message-ID:  <202207291848.26TImGO6025146@gitrepo.freebsd.org>

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

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

commit c456a060ecc56d1a51d8a60c265ae2ac39c8da4b
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-25 18:15:51 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-29 18:35:36 +0000

    Fix unused variable warning in if_pfsync.c
    
    With clang 15, the following -Werror warning is produced:
    
        sys/netpfil/pf/if_pfsync.c:2153:9: error: variable 'sent' set but not used [-Werror,-Wunused-but-set-variable]
                int i, sent = 0;
                       ^
    
    The 'sent' variable was used in the for loop later in the
    pfsync_bulk_update() function, but refactoring in 4fc65bcbe3fb7 got rid
    of it. Remove the variable since it no longer serves any purpose.
    
    MFC after:      3 days
    
    (cherry picked from commit fb48e998501f8d1defecffb772121a4141cdc2b6)
---
 sys/netpfil/pf/if_pfsync.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c
index 470c2f176328..da1d17452cb0 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -2149,7 +2149,7 @@ pfsync_bulk_update(void *arg)
 {
 	struct pfsync_softc *sc = arg;
 	struct pf_kstate *s;
-	int i, sent = 0;
+	int i;
 
 	PFSYNC_BLOCK_ASSERT(sc);
 	CURVNET_SET(sc->sc_ifp->if_vnet);
@@ -2190,7 +2190,6 @@ pfsync_bulk_update(void *arg)
 					    pfsync_bulk_update, sc);
 					goto full;
 				}
-				sent++;
 			}
 		}
 		PF_HASHROW_UNLOCK(ih);



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