Re: [PATCH 2/2] drm: ensure drm headers are self-contained and pass kernel-doc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 3, 2025 at 10:53 PM Jani Nikula <jani.nikula@xxxxxxxxx> wrote:
>
> On Mon, 03 Mar 2025, Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> > On Mon, Mar 3, 2025 at 7:02 PM Jani Nikula <jani.nikula@xxxxxxxxx> wrote:
> >>
> >> On Mon, 03 Mar 2025, Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> >> And one of the underlying goals is to make for minimal headers with
> >> minimal includes and minimal dependencies, preferring forward
> >> declarations over includes, splitting functionality by header, etc. It's
> >> just that doing that often leads to broken headers, unless you actually
> >> build test them... and here we are.
> >
> >
> > What I learned from my last attempt is that we cannot avoid
> > false positives without adding a lot of exceptions.
>
> All of the drm core, xe and i915 headers build fine without
> exceptions. There are no false positives. (*)
>
> > We can never be certain whether you are making DRM headers
> > self-contained for valid reasons or for hypothetical, invalid ones.
>
> Please enlighten me. What are hypothetical, invalid reasons for making
> headers self-contained?

See this thread:
https://lore.kernel.org/all/20190718130835.GA28520@xxxxxx/

When CONFIG_BLOCK=n, it does not make sense to
ensure <linux/iomap.h> is self-contained.
This is just one example.

I am pretty sure I observed more false-positives
in header compile tests.

>
> IMO headers should almost invariably be self-contained, instead of
> putting the burden on their users to include other headers to make it
> work. It's a PITA in a project the size of the kernel, or even just the
> drm subsystem, to track these cases when you modify includes in either
> users or the headers being included.
>
> The exception to this are headers that are not to be included directly
> by users, but rather by other headers as an implementation detail. There
> may be such cases in include/linux, but not under include/drm.

This results in a false check for include/linux/.

I don’t see much sense in doing this exceptionally for include/drm/
after we've learned that it doesn't work globally.





>
> BR,
> Jani.
>
>
> (*) Fine, there's one *intentional* special case in i915.
>
> --
> Jani Nikula, Intel



-- 
Best Regards
Masahiro Yamada




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux