mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Jakub Kicinski <kuba@kernel.org>,
	dhowells@redhat.com, kees@kernel.org, gustavoars@kernel.org,
	aleksander.lobakin@intel.com, tstruk@gigaio.com
Subject: [PATCH] stddef: don't include compiler_types.h in the uAPI header
Date: Wed, 21 May 2025 14:26:44 -0700	[thread overview]
Message-ID: <20250521212644.981148-1-kuba@kernel.org> (raw)

The uAPI stddef header includes compiler_types.h, a non-uAPI
header. There is a hack in scripts/headers_install.sh which
strips includes of compiler.h and compiler_types.h.

But AFAICT there is nothing in stddef.h which would need
the include. The include dates back to when uAPI stddef.h
was first created, back then the including of compiler.h
was the only line in the file. So presumably stddef.h
has been including compiler headers to retain some
chain of dependency? Perhaps someone with more build system
understanding knows what that chain would be, given
kernel doesn't include uAPI stddef.h, and user space
has the compiler headers stripped.

Since nothing needs this include, let's remove it.
Builds pass on x86, arm64, csky, m68k, riscv32.
The direct motivation for the change is that the includes
of compiler.h and co. make it hard to include uAPI headers
from tools/.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: dhowells@redhat.com
CC: kees@kernel.org
CC: gustavoars@kernel.org
CC: aleksander.lobakin@intel.com
CC: tstruk@gigaio.com
---
 include/uapi/linux/stddef.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
index b87df1b485c2..3da0266643e6 100644
--- a/include/uapi/linux/stddef.h
+++ b/include/uapi/linux/stddef.h
@@ -2,8 +2,6 @@
 #ifndef _UAPI_LINUX_STDDEF_H
 #define _UAPI_LINUX_STDDEF_H
 
-#include <linux/compiler_types.h>
-
 #ifndef __always_inline
 #define __always_inline inline
 #endif
-- 
2.49.0


                 reply	other threads:[~2025-05-21 21:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250521212644.981148-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=aleksander.lobakin@intel.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=gustavoars@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tstruk@gigaio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®