Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jul 2022 08:58:26 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: 9dcb9a1e7b75 - stable/13 - Fix unused variable warning in if_alc.c
Message-ID:  <202207230858.26N8wQ7X012806@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=9dcb9a1e7b756d79b771af64a69edab5975863b7

commit 9dcb9a1e7b756d79b771af64a69edab5975863b7
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-16 15:06:31 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-23 08:56:46 +0000

    Fix unused variable warning in if_alc.c
    
    With clang 15, the following -Werror warning is produced:
    
        sys/dev/alc/if_alc.c:3441:6: error: variable 'prog' set but not used [-Werror,-Wunused-but-set-variable]
                int prog;
                    ^
    
    The 'prog' variable seems to be a left-over from some debugging code
    that no longer exists, and can be removed without any functional change.
    
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D35831
    
    (cherry picked from commit 64741244fc4588eefd954948b77ddf2706448ecd)
---
 sys/dev/alc/if_alc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c
index eb906d60bcbe..f0d756b3e865 100644
--- a/sys/dev/alc/if_alc.c
+++ b/sys/dev/alc/if_alc.c
@@ -3439,7 +3439,6 @@ alc_txeof(struct alc_softc *sc)
 	struct ifnet *ifp;
 	struct alc_txdesc *txd;
 	uint32_t cons, prod;
-	int prog;
 
 	ALC_LOCK_ASSERT(sc);
 
@@ -3468,11 +3467,9 @@ alc_txeof(struct alc_softc *sc)
 	 * Go through our Tx list and free mbufs for those
 	 * frames which have been transmitted.
 	 */
-	for (prog = 0; cons != prod; prog++,
-	    ALC_DESC_INC(cons, ALC_TX_RING_CNT)) {
+	for (; cons != prod; ALC_DESC_INC(cons, ALC_TX_RING_CNT)) {
 		if (sc->alc_cdata.alc_tx_cnt <= 0)
 			break;
-		prog++;
 		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 		sc->alc_cdata.alc_tx_cnt--;
 		txd = &sc->alc_cdata.alc_txdesc[cons];



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