Re: [PATCH 07/10] drm/gem: Switch to __nonnull_args() macro

From: Dmitry Ilvokhin

Date: Thu Oct 29 2026 - 09:12:35 EST


On Thu, Oct 29, 2026 at 02:00:28PM +0100, Miguel Ojeda wrote:
> On Thu, Oct 29, 2026 at 8:32 AM Thomas Zimmermann <tzimmermann@xxxxxxx> wrote:
> >
> > Should gem.h now include <linux/compiler_attributes.h> ?
>
> No, it should be included for you (unless you are doing something
> custom with the compiler flags etc.).

Just to add a bit more colour to Miguel's reply.

I believe idea behind include/linux/compiler_attributes.h is to make
attribute wrappers as simple and transparent to use as native compiler
attributes. In particular, this means they should be available in every
kernel compilation unit without any additional effort.

For this reason, all the nessesary plumbing is handled at the build
machinery level (see scripts/Makefile.lib:171), where '-include'
compiler flag is used to pull in include/linux/compiler_types.h, which
in turn pulls include/linux/compiler_attributes.h.