Page MenuHomeFreeBSD

linuxkpi: Split <linux/compiler.h>
ClosedPublic

Authored by dumbbell on Jan 4 2026, 10:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 8, 2:05 PM
Unknown Object (File)
Mon, Jan 26, 11:09 AM
Unknown Object (File)
Thu, Jan 22, 5:40 PM
Unknown Object (File)
Wed, Jan 21, 3:35 PM
Unknown Object (File)
Wed, Jan 21, 8:04 AM
Unknown Object (File)
Mon, Jan 19, 12:04 AM
Unknown Object (File)
Thu, Jan 15, 7:49 AM
Unknown Object (File)
Sun, Jan 11, 6:14 PM
Subscribers

Details

Summary

On Linux, they split the content into three headers:

  1. <linux/compiler.h>
  2. <linux/compiler_types.h>
  3. <linux/compiler_attributes.h>

The first includes the second, which includes the third.

<linux/compiler_types.h> is also included on the compiler command line by default! I added that to the compilation flags of the DRM drivers.

This allowed me to drop at least one:

#ifdef __FreeBSD
#include <linux/compiler.h>
#endif

Note that our copy of <linux/compiler.h> contains definitions which are not defined by Linux' <linux/compiler.h>. I left them alone.

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

This revision is now accepted and ready to land.Jan 5 2026, 5:05 PM
This revision was automatically updated to reflect the committed changes.
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/compiler.h
36

What is the reason not to include them as <linux/compiler_types.h> here and in the other file if that is an official Linux[KPI] include file?

sys/compat/linuxkpi/common/include/linux/compiler.h
36

Mmm, probably should be