Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2017 02:33:26 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316806 - head/sys/dev/fxp
Message-ID:  <201704140233.v3E2XQCh072936@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Fri Apr 14 02:33:26 2017
New Revision: 316806
URL: https://svnweb.freebsd.org/changeset/base/316806

Log:
  Remove unnecessary comparison.
  
  Found by:	PVS-Studio

Modified:
  head/sys/dev/fxp/if_fxp.c

Modified: head/sys/dev/fxp/if_fxp.c
==============================================================================
--- head/sys/dev/fxp/if_fxp.c	Fri Apr 14 02:24:02 2017	(r316805)
+++ head/sys/dev/fxp/if_fxp.c	Fri Apr 14 02:33:26 2017	(r316806)
@@ -2212,18 +2212,15 @@ fxp_stop(struct fxp_softc *sc)
 	 * Release any xmit buffers.
 	 */
 	txp = sc->fxp_desc.tx_list;
-	if (txp != NULL) {
-		for (i = 0; i < FXP_NTXCB; i++) {
-			if (txp[i].tx_mbuf != NULL) {
-				bus_dmamap_sync(sc->fxp_txmtag, txp[i].tx_map,
-				    BUS_DMASYNC_POSTWRITE);
-				bus_dmamap_unload(sc->fxp_txmtag,
-				    txp[i].tx_map);
-				m_freem(txp[i].tx_mbuf);
-				txp[i].tx_mbuf = NULL;
-				/* clear this to reset csum offload bits */
-				txp[i].tx_cb->tbd[0].tb_addr = 0;
-			}
+	for (i = 0; i < FXP_NTXCB; i++) {
+		if (txp[i].tx_mbuf != NULL) {
+			bus_dmamap_sync(sc->fxp_txmtag, txp[i].tx_map,
+			    BUS_DMASYNC_POSTWRITE);
+			bus_dmamap_unload(sc->fxp_txmtag, txp[i].tx_map);
+			m_freem(txp[i].tx_mbuf);
+			txp[i].tx_mbuf = NULL;
+			/* clear this to reset csum offload bits */
+			txp[i].tx_cb->tbd[0].tb_addr = 0;
 		}
 	}
 	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map,



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