From owner-svn-src-head@FreeBSD.ORG Tue Nov 1 02:07:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 615E11065677; Tue, 1 Nov 2011 02:07:43 +0000 (UTC) Date: Tue, 1 Nov 2011 02:07:43 +0000 From: Alexey Dokuchaev To: Bruce Evans Message-ID: <20111101020743.GA14822@FreeBSD.org> References: <201110302117.p9ULHgLD085245@svn.freebsd.org> <20111031042526.GA57014@FreeBSD.org> <20111031233854.Y1523@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20111031233854.Y1523@besplex.bde.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r226947 - in head/sys: dev/esp sparc64/sbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 02:07:43 -0000 On Tue, Nov 01, 2011 at 12:01:16AM +1100, Bruce Evans wrote: > On Mon, 31 Oct 2011, Alexey Dokuchaev wrote: > > When convention requires a typedef, make its name match the struct tag. > > Avoid typedefs ending in _t, except as specified in Standard C or by > > POSIX. > > > > Do these rules not apply for struct device for some reason? > > Yes (they don't apply here). device_t is one of a few properly opaque > typedefs for struct pointers. 'struct device' is only (completely) > declared in kern/subr_bus.c. Thus the implementation details of it > obviously cannot escape to drivers. Most of the APIs in > are supposed to be like this. But `typedef struct kobj_class driver_t' > and `#define driver_method_t kobj_method_t' are gross exceptions. > has to include for dereferencing these, and > kobj.h breaks the rule by providing both typedefs for struct pointers > and complete struct declarations. Thanks for detailed explanation Bruce. ./danfe