From owner-freebsd-net Tue Jul 30 11:18:13 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72CC837B401 for ; Tue, 30 Jul 2002 11:18:08 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BA5043E67 for ; Tue, 30 Jul 2002 11:18:07 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id EAA28694; Wed, 31 Jul 2002 04:17:48 +1000 Date: Wed, 31 Jul 2002 04:22:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Brooks Davis Cc: "M. Warner Losh" , Subject: Re: switching to if_xname from if_name and if_unit In-Reply-To: <20020730101533.A29988@Odin.AC.HMC.Edu> Message-ID: <20020731041621.H56544-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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