Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 May 2014 13:21:34 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265770 - head/sys/dev/etherswitch/ip17x
Message-ID:  <201405091321.s49DLYIq059470@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405091321.s49DLYIq059470>