Date: Sun, 24 Jul 2022 11:02:32 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: f895c3b38743 - stable/12 - Fix unused variable warning in if_re_netmap.h Message-ID: <202207241102.26OB2W7M041663@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=f895c3b3874385f1302c727a9bb2fa1bc1f08b11 commit f895c3b3874385f1302c727a9bb2fa1bc1f08b11 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2022-07-21 19:52:29 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2022-07-24 11:01:22 +0000 Fix unused variable warning in if_re_netmap.h With clang 15, the following -Werror warning is produced: sys/dev/netmap/if_re_netmap.h:179: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 8bfedf5852bcb846bfdd2a54989d65cdbb16f7ef) --- sys/dev/netmap/if_re_netmap.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/netmap/if_re_netmap.h b/sys/dev/netmap/if_re_netmap.h index 0e56a731ac6a..7c356ab4bd22 100644 --- a/sys/dev/netmap/if_re_netmap.h +++ b/sys/dev/netmap/if_re_netmap.h @@ -176,7 +176,6 @@ re_netmap_rxsync(struct netmap_kring *kring, int flags) struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ 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; int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; @@ -236,7 +235,7 @@ re_netmap_rxsync(struct netmap_kring *kring, int flags) nm_i = kring->nr_hwcur; if (nm_i != head) { nic_i = netmap_idx_k2n(kring, nm_i); - for (n = 0; nm_i != head; n++) { + while (nm_i != head) { struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; void *addr = PNMB(na, slot, &paddr);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207241102.26OB2W7M041663>