From 8237ba8ab394657acac6f4af6f2d61867649c334 Mon Sep 17 00:00:00 2001 From: Luiz Otavio O Souza Date: Fri, 9 May 2014 13:21:34 +0000 Subject: [PATCH] Fix the build with debug enabled and remove a variable used only at switch initialization, it is nonsense keep it around without futher use. --- sys/dev/etherswitch/ip17x/ip17x.c | 14 ++++---------- sys/dev/etherswitch/ip17x/ip17x_var.h | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c index cfe8323c5dcb..2f51217c7363 100644 --- a/sys/dev/etherswitch/ip17x/ip17x.c +++ b/sys/dev/etherswitch/ip17x/ip17x.c @@ -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, struct ifmediareq *ifmr) 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; diff --git a/sys/dev/etherswitch/ip17x/ip17x_var.h b/sys/dev/etherswitch/ip17x/ip17x_var.h index 2259a655eb01..a1f418754d96 100644 --- a/sys/dev/etherswitch/ip17x/ip17x_var.h +++ b/sys/dev/etherswitch/ip17x/ip17x_var.h @@ -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;