git: 0f99030d3547 - stable/12 - Fix unused variable warning in iflib.c

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sun, 24 Jul 2022 11:02:29 UTC
The branch stable/12 has been updated by dim:

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

commit 0f99030d35478242a57bc9fdae6bfc732a69dc81
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-21 19:19:28 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-24 11:01:21 +0000

    Fix unused variable warning in iflib.c
    
    With clang 15, the following -Werror warning is produced:
    
        sys/net/iflib.c:993:8: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
                u_int n;
                      ^
    
    The 'n' variable appears to have been a debugging aid that has never
    been used for anything, so remove it.
    
    MFC after:      3 days
    
    (cherry picked from commit 0294e95da4aa272906d4472137b1235d8d8a7180)
---
 sys/net/iflib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index f057b7deba91..170e502481c8 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -996,7 +996,6 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags)
 	struct netmap_ring *ring = kring->ring;
 	u_int nm_i;	/* index into the netmap kring */
 	u_int nic_i;	/* index into the NIC ring */
-	u_int n;
 	u_int const lim = kring->nkr_num_slots - 1;
 	u_int const head = kring->rhead;
 	struct if_pkt_info pi;
@@ -1049,7 +1048,7 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags)
 		__builtin_prefetch(&txq->ift_sds.ifsd_m[nic_i]);
 		__builtin_prefetch(&txq->ift_sds.ifsd_map[nic_i]);
 
-		for (n = 0; nm_i != head; n++) {
+		while (nm_i != head) {
 			struct netmap_slot *slot = &ring->slot[nm_i];
 			u_int len = slot->len;
 			uint64_t paddr;