Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2021 07:30:30 -0700
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Mark Johnston <markj@FreeBSD.org>
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:  <202104121430.13CEUUIq030729@slippy.cwsent.com>
In-Reply-To: <202104121336.13CDaI5A029079@gitrepo.freebsd.org>
References:  <202104121336.13CDaI5A029079@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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. 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?202104121430.13CEUUIq030729>