netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] stddef: don't include compiler_types.h in the uAPI header
@ 2025-08-18 18:18 Jakub Kicinski
  2025-08-19  4:06 ` Kees Cook
  2025-08-19  9:26 ` kernel test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Jakub Kicinski @ 2025-08-18 18:18 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, andrew+netdev, horms, Jakub Kicinski,
	dhowells, kees, gustavoars, aleksander.lobakin, tstruk

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>
---
More than happy for someone else to take this via their tree, FWIW.

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.50.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-26 13:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 18:18 [PATCH net-next] stddef: don't include compiler_types.h in the uAPI header Jakub Kicinski
2025-08-19  4:06 ` Kees Cook
2025-08-20 17:17   ` Jakub Kicinski
2025-08-26  2:54     ` Kees Cook
2025-08-26 13:47       ` Jakub Kicinski
2025-08-19  9:26 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).