Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2021 10:36:35 -0400
From:      Mark Johnston <markj@freebsd.org>
To:        Cy Schubert <Cy.Schubert@cschubert.com>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: dfff37765ce4 - main - Rename struct device to struct _device
Message-ID:  <YHRa8%2B0T27fRCoLN@nuc>
In-Reply-To: <202104121430.13CEUUIq030729@slippy.cwsent.com>
References:  <202104121336.13CDaI5A029079@gitrepo.freebsd.org> <202104121430.13CEUUIq030729@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 12, 2021 at 07:30:30AM -0700, Cy Schubert wrote:
> In message <202104121336.13CDaI5A029079@gitrepo.freebsd.org>, Mark Johnston 
> wri
> tes:
> > The branch main has been updated by markj:
> >
> > URL: https://cgit.FreeBSD.org/src/commit/?id=dfff37765ce4ea4fd7db4d293b459dc8
> > 4008f411
> >
> > commit dfff37765ce4ea4fd7db4d293b459dc84008f411
> > Author:     Mark Johnston <markj@FreeBSD.org>
> > AuthorDate: 2021-04-12 13:32:30 +0000
> > Commit:     Mark Johnston <markj@FreeBSD.org>
> > CommitDate: 2021-04-12 13:32:30 +0000
> >
> >     Rename struct device to struct _device
> >     
> >     types.h defines device_t as a typedef of struct device *.  struct device
> >     is defined in subr_bus.c and almost all of the kernel uses device_t.
> >     The LinuxKPI also defines a struct device, so type confusion can occur.
> >     
> >     This causes bugs and ambiguity for debugging tools.  Rename the FreeBSD
> >     struct device to struct _device.
> >     
> >     Reviewed by:    gbe (man pages)
> >     Reviewed by:    rpokala, imp, jhb
> >     MFC after:      1 week
> >     Sponsored by:   The FreeBSD Foundation
> >     Differential Revision:  https://reviews.freebsd.org/D29676
> > ---
> >  share/man/man9/device.9       |  2 +-
> >  share/man/man9/rman.9         |  6 +++---
> >  sys/kern/subr_bus.c           | 15 +++++++++------
> >  sys/powerpc/include/bus_dma.h |  4 +---
> >  sys/sys/pcpu.h                |  2 +-
> >  sys/sys/systm.h               |  4 +---
> >  sys/sys/types.h               |  2 +-
> >  7 files changed, 17 insertions(+), 18 deletions(-)
> 
> Not that a name matters much but struct _device gives me a sense that the 
> struct is ancillary.

That's really the intent.  struct _device is the internal name and
device_t should be used by consumers.

> Whereas freebsd_device or fbsd_device is more 
> descriptive and gives the struct the status it deserves.
> 
> Then again, maybe it's just me.
> 
> 
> -- 
> Cheers,
> Cy Schubert <Cy.Schubert@cschubert.com>
> FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
> NTP:           <cy@nwtime.org>    Web:  https://nwtime.org
> 
> 	The need of the many outweighs the greed of the few.
> 
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YHRa8%2B0T27fRCoLN>