Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jul 2002 04:22:23 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        "M. Warner Losh" <imp@bsdimp.com>, <net@FreeBSD.ORG>
Subject:   Re: switching to if_xname from if_name and if_unit
Message-ID:  <20020731041621.H56544-100000@gamplex.bde.org>
In-Reply-To: <20020730101533.A29988@Odin.AC.HMC.Edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 30 Jul 2002, Brooks Davis wrote:

> On Mon, Jul 29, 2002 at 10:38:34PM -0600, M. Warner Losh wrote:
> > : @@ -280,8 +280,7 @@ ep_attach(sc)
> > :         attached = (ifp->if_softc != 0);
> > :
> > :         ifp->if_softc = sc;
> > : -       ifp->if_unit = sc->unit;
> > : -       ifp->if_name = "ep";
> > : +       sprintf(ifp->if_xname, "ep%d", sc->unit);
> >
> > 	strcpy(ifp->if_xname, device_get_name(sc->dev));
> >
> > might be better, don't you think?

I think this point has already been covered better by noticing that the
name is already stored in several other places (not just new-bus).

> Yes, that's probably better.  At least it's one less place that needs to
> know the name of the device.

Except it gets the name wrong (it should use device_get_nameunit()), and
it is not so clear that the name fits in the buffer.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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