If it was exclusively accessible within the kernel I'd agree that it probably 
isn't neccessary, the trouble is that it is also accessible by userland 
programs. pcidump is an example of a userland program that is part of the 
OpenBSD project and includes the header, and that file acts as a reference 
implantation of sorts for any program that needs to discover PCI devices.

Notwithstanding that, if all it takes to avoid potential confusion and wasted 
time among developers is a one line include statement, does the header file 
having limited uses within the kernel really make it not worth doing? 


I'll even fix it myself and submit a patch. I'd just hate to see this quirk be 
neither remedied nor documented in some form. 


Let me know what you guys think though.

Thanks,
Gibson Pilconis




On Tuesday, March 26th, 2024 at 12:37 PM, Stuart Henderson 
<s...@spacehopper.org> wrote:

> 

> 

> On 2024/03/25 05:12, Gibson Pilconis wrote:
> 

> > Hi.
> > 

> > I'm working on a project that supports OpenBSD and I noticed that 
> > pcidevs_data.h uses
> > structures defined in pcireg.h but doesn't include the file. As a result, 
> > pcireg.h has to be
> > included before pcidevs_data.h or else the compiler will throw an error.
> > 

> > I'm not sure if this is considered a bug or not, but I couldn't find any 
> > documentation of it
> > and I could easily see it confusing newer developers. If adding an include 
> > to the header isn't
> > an option, perhaps adding in a comment informing developers they need to 
> > import pcireg.h would
> > prove useful.
> 

> 

> pcidevs_data.h is almost never included directly, the only file in the
> OpenBSD kernel tree using it is pci_subr.c. So it seems this is probably
> not really needed?

Attachment: publickey - gibsonpil@protonmail.com - 0xE7CBA41E.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to