From owner-svn-src-head@FreeBSD.ORG Tue Aug 31 19:59:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A1D1065675; Tue, 31 Aug 2010 19:59:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44468FC1B; Tue, 31 Aug 2010 19:59:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7VJxI50040334; Tue, 31 Aug 2010 19:59:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7VJxIgk040332; Tue, 31 Aug 2010 19:59:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008311959.o7VJxIgk040332@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 31 Aug 2010 19:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212069 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 31 Aug 2010 19:59:19 -0000 Author: yongari Date: Tue Aug 31 19:59:18 2010 New Revision: 212069 URL: http://svn.freebsd.org/changeset/base/212069 Log: bge_txeof() already checks whether it has to free transmitted mbufs or not by comparing reported TX consumer index with saved index. So remove unnecessary check done after freeing transmitted mbufs. While I'm here nuke unnecessary variable initializations. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Aug 31 19:26:29 2010 (r212068) +++ head/sys/dev/bge/if_bge.c Tue Aug 31 19:59:18 2010 (r212069) @@ -3394,7 +3394,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t static void bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { - struct bge_tx_bd *cur_tx = NULL; + struct bge_tx_bd *cur_tx; struct ifnet *ifp; BGE_LOCK_ASSERT(sc); @@ -3412,7 +3412,7 @@ bge_txeof(struct bge_softc *sc, uint16_t * frames that have been sent. */ while (sc->bge_tx_saved_considx != tx_cons) { - uint32_t idx = 0; + uint32_t idx; idx = sc->bge_tx_saved_considx; cur_tx = &sc->bge_ldata.bge_tx_ring[idx]; @@ -3431,8 +3431,7 @@ bge_txeof(struct bge_softc *sc, uint16_t BGE_INC(sc->bge_tx_saved_considx, BGE_TX_RING_CNT); } - if (cur_tx != NULL) - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (sc->bge_txcnt == 0) sc->bge_timer = 0; }