Page MenuHomeFreeBSD

linuxkpi: Replicate Linux #includes between headers
ClosedPublic

Authored by dumbbell on Sun, Jan 4, 10:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 10, 5:40 AM
Unknown Object (File)
Fri, Jan 9, 7:34 PM
Unknown Object (File)
Fri, Jan 9, 2:06 AM
Unknown Object (File)
Thu, Jan 8, 11:45 PM
Unknown Object (File)
Thu, Jan 8, 6:55 PM
Unknown Object (File)
Thu, Jan 8, 6:54 AM
Unknown Object (File)
Thu, Jan 8, 4:06 AM
Unknown Object (File)
Mon, Jan 5, 2:49 PM
Subscribers

Details

Summary

The DRM drivers (and probably other parts of the Linux kernel) had a significant cleanup w.r.t. which source file includes what in Linux 6.10. Nonetheless, the DRM drivers still depend on implicit namespace pollution because some source files do not include all the headers they should.

This cleanup broke the build with FreeBSD because we do not replicate the same #include directives everywhere.

This commit adds the same #include directives in several headers in order to get the same namespace pollution.

This fixes the build of the DRM drivers from Linux 6.10. An example is drm_dp_tunnel.c which needed str_yes_no() defined by <linux/string_helpers.h> (technically <linux/string_choices.h> in Linux). It gets it through:

<linux/i2c.h> -> <linux/regulator/consumer.h> -> <linux/suspend.h> ->
<linux/swap.h> -> <linux/memcontrol.h> -> <linux/cgroup.h> ->
<linux/seq_file.h> -> <linux/string_helpers.h>

This is part of the update of DRM drivers to Linux 6.10.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste added inline comments.
sys/compat/linuxkpi/common/include/linux/cgroup.h
34

Looks like latest Linux version includes linux/list.h instead

sys/compat/linuxkpi/common/include/linux/regulator/consumer.h
7–29

If desired you can leave out the license block and have just the SPDX tag.

This revision is now accepted and ready to land.Mon, Jan 5, 5:02 PM

Thank you! I addressed your comments.

bz added inline comments.
sys/compat/linuxkpi/common/include/linux/memcontrol.h
43

Would have been no need for defined() in the comment here either.