From nobody Sun Oct 02 04:29:33 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 4Mg9wY6CKlz4dt41; Sun, 2 Oct 2022 04:29:33 +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 4Mg9wY5Rzvz44lr; Sun, 2 Oct 2022 04:29:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664684973; 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=Lltm2DrGtce7GXFCDafKPPt4ecqBzmr9mFz8zphsG1k=; b=riR4Npo/0SATNEeOwwPpIqkPyaq69Yb68M/rvy36OtmBcnOW1EF6AyNhDYpi5ZBI4QJV/f CzV6LDZUQ0wn8XadOoIiPFZeu9rydfREXuiFP461pJOo5P6JGa9xIP1veLNvdI7gcxAxQR cgYG6pOAH1+CybuRJzj91cggR7ErpGxdlmdz2XcBnGgQlMwlwTCswyY+SqxohH16YVl2uK AVW+Px1KqGLWjirtvrRQTHqCk3aIaCu4f57EoKN2dZB9vEqZhZi+3GrsA42v4gHH1ylCCw ux4kbUvRNm7ETJ5CIRcO1WvrIxXrDWBfC486dqTROsBCyScfoeQydwaikIddkA== 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 4Mg9wY4SLDzlQS; Sun, 2 Oct 2022 04:29:33 +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 2924TXx7058330; Sun, 2 Oct 2022 04:29:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2924TXVZ058329; Sun, 2 Oct 2022 04:29:33 GMT (envelope-from git) Date: Sun, 2 Oct 2022 04:29:33 GMT Message-Id: <202210020429.2924TXVZ058329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 155612c06678 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 155612c066784a0cd38b5c236a01806f204756f0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664684973; 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=Lltm2DrGtce7GXFCDafKPPt4ecqBzmr9mFz8zphsG1k=; b=u8Epx9RVT9R/itKWawNxdYN6JaLR1RdJO7Yjlt+1+ukRdBklFThtwL9BDhizTPFKukNIw3 cyoLuQ5MSXGDiwY3T8lxgYKjCRWm9ApHF3ZrdhHfGr206xAs1onZqjkTWs7bwv2xQch+OX OYcYezJLuwDnHeMwblxvd7YWZExbiu0Inkp4YxHlCmABcdThRzM94duJ3G+K2WtZBVZvxL CCOV0RcoscfoJSS8KeVLCWJAeZT4cRJJWJfQosEuqgYGxqFySVr7o2cE02uOBbx+DQxKUw IKGTLxMACe/Ol5jm6XJrma4204KzU9R1b0UqDlCS+dLx7tILHxzdLvDiuoer2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664684973; a=rsa-sha256; cv=none; b=Wepw1URl9I1zAdG1flCiuq+UYYyxhUcWdgD7sLd9bMekzmX4zEIviZTreIHCRvKQM2UhYD OFdCp+ye7/QoqtL2lBx5IlioNcB0sT0KYYDTQZDjVDLxWfZ0PqX3gCeMKfnwy6JqZgh8VU vdxSz3jbJGKpwtpGuPG6mOjfZIuLuBjuTJ0nzWYGx5lhJ8zFN7wU4Ob1lEVw7PvA3K4cr3 kmASPD/PC5NND86mQqE7Uo8MiFmE4t8TspJHq3AxGNjx3TJc/jPzzaeqsDpz+zKuMFigHa ZSxxJjhuxR5bQcoLSf0sXb7lLIJX30FUVR5hN7ujyaK57sB+IL01Qm8kEAkEPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=155612c066784a0cd38b5c236a01806f204756f0 commit 155612c066784a0cd38b5c236a01806f204756f0 Author: Warner Losh AuthorDate: 2022-07-08 17:53:31 +0000 Commit: Warner Losh CommitDate: 2022-10-02 04:25:53 +0000 mge: eliminate write only variables ifp, sc and error Sponsored by: Netflix (cherry picked from commit f8967810f5b5806c59fb6c8dbcc123dbc9256bb3) --- 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];