git: fb48e998501f - main - Fix unused variable warning in if_pfsync.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 25 Jul 2022 19:51:08 UTC
The branch main has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=fb48e998501f8d1defecffb772121a4141cdc2b6
commit fb48e998501f8d1defecffb772121a4141cdc2b6
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-25 18:15:51 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-25 18:53:48 +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
---
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 8edc5564b9a7..5f082576a3f9 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -2150,7 +2150,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);
@@ -2191,7 +2191,6 @@ pfsync_bulk_update(void *arg)
pfsync_bulk_update, sc);
goto full;
}
- sent++;
}
}
PF_HASHROW_UNLOCK(ih);