From owner-svn-src-head@FreeBSD.ORG Fri May 9 13:21:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EC78107; Fri, 9 May 2014 13:21:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F3DF93D2; Fri, 9 May 2014 13:21:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49DLYNR059472; Fri, 9 May 2014 13:21:34 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49DLYIq059470; Fri, 9 May 2014 13:21:34 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405091321.s49DLYIq059470@svn.freebsd.org> From: Luiz Otavio O Souza Date: Fri, 9 May 2014 13:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265770 - head/sys/dev/etherswitch/ip17x 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.18 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, 09 May 2014 13:21:35 -0000 Author: loos Date: Fri May 9 13:21:34 2014 New Revision: 265770 URL: http://svnweb.freebsd.org/changeset/base/265770 Log: Fix the build with debug enabled and remove a variable used only at switch initialization, it is nonsense keep it around without futher use. Modified: head/sys/dev/etherswitch/ip17x/ip17x.c head/sys/dev/etherswitch/ip17x/ip17x_var.h Modified: head/sys/dev/etherswitch/ip17x/ip17x.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x.c Fri May 9 13:21:14 2014 (r265769) +++ head/sys/dev/etherswitch/ip17x/ip17x.c Fri May 9 13:21:34 2014 (r265770) @@ -141,9 +141,7 @@ ip17x_attach_phys(struct ip17x_softc *sc sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; - sc->ifname[port] = malloc(strlen(name)+1, M_IP17X, M_WAITOK); - bcopy(name, sc->ifname[port], strlen(name)+1); - if_initname(sc->ifp[port], sc->ifname[port], port); + if_initname(sc->ifp[port], name, port); sc->miibus[port] = malloc(sizeof(device_t), M_IP17X, M_WAITOK | M_ZERO); err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port], @@ -204,8 +202,6 @@ ip17x_attach(device_t dev) M_WAITOK | M_ZERO); sc->pvid = malloc(sizeof(uint32_t) * sc->numports, M_IP17X, M_WAITOK | M_ZERO); - sc->ifname = malloc(sizeof(char *) * sc->numports, M_IP17X, - M_WAITOK | M_ZERO); sc->miibus = malloc(sizeof(device_t *) * sc->numports, M_IP17X, M_WAITOK | M_ZERO); sc->portphy = malloc(sizeof(int) * sc->numports, M_IP17X, @@ -257,13 +253,11 @@ ip17x_detach(device_t dev) device_delete_child(dev, (*sc->miibus[port])); if (sc->ifp[port] != NULL) if_free(sc->ifp[port]); - free(sc->ifname[port], M_IP17X); free(sc->miibus[port], M_IP17X); } free(sc->portphy, M_IP17X); free(sc->miibus, M_IP17X); - free(sc->ifname, M_IP17X); free(sc->pvid, M_IP17X); free(sc->ifp, M_IP17X); @@ -490,12 +484,13 @@ ip17x_ifmedia_upd(struct ifnet *ifp) struct ip17x_softc *sc; struct mii_data *mii; - DPRINTF(sc->sc_dev, "%s\n", __func__); sc = ifp->if_softc; + DPRINTF(sc->sc_dev, "%s\n", __func__); mii = ip17x_miiforport(sc, ifp->if_dunit); if (mii == NULL) return (ENXIO); mii_mediachg(mii); + return (0); } @@ -505,9 +500,8 @@ ip17x_ifmedia_sts(struct ifnet *ifp, str struct ip17x_softc *sc; struct mii_data *mii; - DPRINTF(sc->sc_dev, "%s\n", __func__); - sc = ifp->if_softc; + DPRINTF(sc->sc_dev, "%s\n", __func__); mii = ip17x_miiforport(sc, ifp->if_dunit); if (mii == NULL) return; Modified: head/sys/dev/etherswitch/ip17x/ip17x_var.h ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x_var.h Fri May 9 13:21:14 2014 (r265769) +++ head/sys/dev/etherswitch/ip17x/ip17x_var.h Fri May 9 13:21:34 2014 (r265770) @@ -52,7 +52,6 @@ struct ip17x_softc { int phyport[MII_NPHY]; int numports; /* number of ports */ int *portphy; - char **ifname; device_t **miibus; etherswitch_info_t info; ip17x_switch_type sc_switchtype;