From owner-freebsd-arch@FreeBSD.ORG Thu Jun 10 06:32:45 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B4A816A4CE; Thu, 10 Jun 2004 06:32:45 +0000 (GMT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56CE543D2F; Thu, 10 Jun 2004 06:32:44 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i5A6Wf5v019804; Thu, 10 Jun 2004 16:32:41 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i5A6Wb2O005887; Thu, 10 Jun 2004 16:32:39 +1000 Date: Thu, 10 Jun 2004 16:32:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Peter Wemm In-Reply-To: <200406091637.00032.peter@wemm.org> Message-ID: <20040610161500.G7696@gamplex.bde.org> References: <55790.1086796559@critter.freebsd.dk> <200406091637.00032.peter@wemm.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@FreeBSD.org cc: Poul-Henning Kamp cc: freebsd-arch@FreeBSD.org Subject: Re: dev_t / udev_t confusion ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2004 06:32:45 -0000 On Wed, 9 Jun 2004, Peter Wemm wrote: > On Wednesday 09 June 2004 08:55 am, Poul-Henning Kamp wrote: > > In message <53993.1086779790@critter.freebsd.dk>, Poul-Henning Kamp > writes: > > >The change proposed is more or less to do: > > > s/dev_t/struct cdev */ > > > s/udev_t/dev_t/ > > >over all the kernel sources (366 files or so). > > > > Looks like a "yea" so far, so I have a couple of follow-up questions: > > I had a slight preference for 'kdev_t *' in the kernel, but 'struct cdev > *' works for me as well so I've changed my mind. No objection from me > then. This would be a large style bug (more of a design error, but not doing it is documented in style(9)): %%% STYLE(9) FreeBSD Kernel Developer's Manual STYLE(9) NAME style -- kernel source file style guide ... Avoid using typedefs for structure types. Typedefs are problematic because they do not properly hide their underlying type; for example you need to know if the typedef is the structure itself or a pointer to the structure. In addition they must be declared exactly once, whereas an incomplete structure type can be mentioned as many times as necessary. Typedefs are difficult to use in stand-alone header files: the header that defines the typedef must be included before the header that uses it, or by the header that uses it (which causes namespace pollution), or there must be a back-door mechanism for obtaining the typedef. %%% Bruce