From nobody Tue Apr 05 04:32:23 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 743BE1A90D16; Tue, 5 Apr 2022 04:32:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KXZVw0Wt9z4gM5; Tue, 5 Apr 2022 04:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649133144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z0ldhvVxqL/P1aPWZ29+E4JtP9S4h8eJ92/ay6Db7s0=; b=ml84X/iUDsVwg6mRlsLbaoDZtWnfM3jg6YYheVVNbkIvOtz0rIsHFDVACbQxrFvIRr2DwB VjaVBCwX/fxC+JTbQY27btbTQbRzjwZBLH3RHZ75/OaLgi1sT6TA19jDSjHBI9c411hPxL pVMo5w1YsnAfwFN66a9X99fNrgYltV0G0C3xDaAvJ9cx/6fsocSOH44lxe0JB/9Y5J1U3z 8Cf3Eqp0+hoEvxyFicrMjsqy/xSTcKWIwZD4HD/I+1ryNEhqeY1D98lvUIn+cX9+jjCMV7 lYniB9K/IuIE17qKoj3BHD101Ir4olryvz/VuUGI8r6PDyDaVnnb967qLZ1rXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B3201F856; Tue, 5 Apr 2022 04:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2354WNTb008935; Tue, 5 Apr 2022 04:32:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2354WNQ7008934; Tue, 5 Apr 2022 04:32:23 GMT (envelope-from git) Date: Tue, 5 Apr 2022 04:32:23 GMT Message-Id: <202204050432.2354WNQ7008934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f8967810f5b5 - main - mge: eliminate write only variables ifp, sc and error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8967810f5b5806c59fb6c8dbcc123dbc9256bb3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649133144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z0ldhvVxqL/P1aPWZ29+E4JtP9S4h8eJ92/ay6Db7s0=; b=oFbjDTCpsbBuFwEp8XFBUu20UjlLZVRH+T7ZYdPfvtJe5PTWCLjulYQZoIyGJkpdav25vV S02OGoRR7fCYjzlAGKe+Wz+NEi0WIuuTQNyO+93fa+zjLVLl9SXqJiPRIAtIaaG4mOfo2b ewTOcVwiBE7q4215A1ea0g04VoqwAkTNrBFw36eTPvIATOX54yPEl896yfv8jHdbzZgxu3 nCjq5XZm7PncavIgYDvV/8Rqxa10FSHD2HhuwE0dv5LjNUEcMq6ZYNQgTL1GhN/L/oPHwt 6KtR65Xz1pZefg6C8ebzyRXJ3+aUG58dbzXMcbBcHtCThuhxhGtzdfgUc6laVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649133144; a=rsa-sha256; cv=none; b=S4CPnhmi/0mMMF5OAKVazmcAr6mEB7HMNZDg3b7WRyy5+SEJD54tBXHj85BzbUAIYf5ype v1gRq2nXK4T6xebOuVY/67qxpP6bya2d00hcTZuQNc+Dt7XRCf8NR3rdjONesKROUTPjso hZb86oeUPd98xgQ+0XeNfyFM9iq1HNBoBHa7mbsT9dvbGctVOkprd4A0bxgf7p3z4nVf7T rcsY/qCoJ1b4BS3AmLYG4pKHA1/1ux2T/p5z5tvipdMMLsTE8qaP0kTHTMSPJEJnSyW30E /AlYZhKYvj84O8XbSqKfXOM0dygb6oayS+ENqDpLlqSKbiKBS9KvXhUzTMbF7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8967810f5b5806c59fb6c8dbcc123dbc9256bb3 commit f8967810f5b5806c59fb6c8dbcc123dbc9256bb3 Author: Warner Losh AuthorDate: 2022-04-05 02:08:21 +0000 Commit: Warner Losh CommitDate: 2022-04-05 04:29:41 +0000 mge: eliminate write only variables ifp, sc and error Sponsored by: Netflix --- sys/dev/mge/if_mge.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/dev/mge/if_mge.c b/sys/dev/mge/if_mge.c index c43163afe3a7..3c447a48f564 100644 --- a/sys/dev/mge/if_mge.c +++ b/sys/dev/mge/if_mge.c @@ -628,12 +628,11 @@ mge_alloc_desc_dma(struct mge_softc *sc, struct mge_desc_wrapper* tab, static int mge_allocate_dma(struct mge_softc *sc) { - int error; struct mge_desc_wrapper *dw; int i; /* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */ - error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), /* parent */ + bus_dma_tag_create(bus_get_dma_tag(sc->dev), /* parent */ 16, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -929,9 +928,8 @@ mge_attach(device_t dev) } if (sc->switch_attached) { - device_t child; MGE_WRITE(sc, MGE_REG_PHYDEV, MGE_SWITCH_PHYDEV); - child = device_add_child(dev, "mdio", -1); + device_add_child(dev, "mdio", -1); bus_generic_attach(dev); } @@ -1582,8 +1580,6 @@ mge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) static int mge_miibus_readreg(device_t dev, int phy, int reg) { - struct mge_softc *sc; - sc = device_get_softc(dev); KASSERT(!switch_attached, ("miibus used with switch attached")); @@ -1593,8 +1589,6 @@ mge_miibus_readreg(device_t dev, int phy, int reg) static int mge_miibus_writereg(device_t dev, int phy, int reg, int value) { - struct mge_softc *sc; - sc = device_get_softc(dev); KASSERT(!switch_attached, ("miibus used with switch attached")); @@ -1648,15 +1642,12 @@ static int mge_encap(struct mge_softc *sc, struct mbuf *m0) { struct mge_desc_wrapper *dw = NULL; - struct ifnet *ifp; bus_dma_segment_t segs[MGE_TX_DESC_NUM]; bus_dmamap_t mapp; int error; int seg, nsegs; int desc_no; - ifp = sc->ifp; - /* Fetch unused map */ desc_no = sc->tx_desc_curr; dw = &sc->mge_tx_desc[desc_no];