From owner-svn-src-head@freebsd.org Fri Apr 14 02:33:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F28BD3D7B8; Fri, 14 Apr 2017 02:33:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10FABF0F; Fri, 14 Apr 2017 02:33:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E2XQlG072937; Fri, 14 Apr 2017 02:33:26 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E2XQCh072936; Fri, 14 Apr 2017 02:33:26 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201704140233.v3E2XQCh072936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 14 Apr 2017 02:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316806 - head/sys/dev/fxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 02:33:27 -0000 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,