Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jul 2022 11:01:53 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: 668beb3273cb - stable/13 - Fix unused variable warning in iflib.c
Message-ID:  <202207241101.26OB1rh6040901@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=668beb3273cb9462dc5d8af4619efd450c2086a0

commit 668beb3273cb9462dc5d8af4619efd450c2086a0
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:00:09 +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 90cc2f851804..eeeadd9c3f48 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -987,7 +987,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;
@@ -1040,7 +1039,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;



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