[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250402124656.629226-3-jani.nikula@intel.com>
Date: Wed, 2 Apr 2025 15:46:54 +0300
From: Jani Nikula <jani.nikula@...el.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Cc: jani.nikula@...el.com,
Jason Gunthorpe <jgg@...dia.com>,
Masahiro Yamada <masahiroy@...nel.org>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona.vetter@...ll.ch>,
linux-kbuild@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
intel-xe@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org
Subject: [PATCH v2 2/4] drm: switch to generic header check facility
Switch to the generic header check facility, and sunset the copy-pasted
local version.
Keep CONFIG_DRM_HEADER_TEST around for fine-grained control of what gets
checked. To be unified later.
Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
Closes: https://lore.kernel.org/r/CAHk-=wjMrqzuUmH-mFbR_46EWEFS=bB=J7h9ABMVy56Vi81PKQ@mail.gmail.com
Fixes: 62ae45687e43 ("drm: ensure drm headers are self-contained and pass kernel-doc")
Cc: Masahiro Yamada <masahiroy@...nel.org>
Cc: David Airlie <airlied@...il.com>
Cc: Simona Vetter <simona.vetter@...ll.ch>
Signed-off-by: Jani Nikula <jani.nikula@...el.com>
---
Cc: linux-kbuild@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org
Cc: intel-xe@...ts.freedesktop.org
Cc: intel-gfx@...ts.freedesktop.org
---
drivers/gpu/drm/Kconfig | 2 +-
drivers/gpu/drm/Makefile | 15 +--------------
include/drm/Makefile | 15 +--------------
3 files changed, 3 insertions(+), 29 deletions(-)
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 2cba2b6ebe1c..10189d0ec30d 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -505,7 +505,7 @@ config DRM_WERROR
config DRM_HEADER_TEST
bool "Ensure DRM headers are self-contained and pass kernel-doc"
- depends on DRM && EXPERT && BROKEN
+ depends on DRM && HEADER_CHECK
default n
help
Ensure the DRM subsystem headers both under drivers/gpu/drm and
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index ed54a546bbe2..fb2642d46f29 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -225,19 +225,6 @@ obj-$(CONFIG_DRM_LOONGSON) += loongson/
obj-$(CONFIG_DRM_POWERVR) += imagination/
# Ensure drm headers are self-contained and pass kernel-doc
-hdrtest-files := \
+header-check-$(CONFIG_DRM_HEADER_TEST) += \
$(shell cd $(src) && find . -maxdepth 1 -name 'drm_*.h') \
$(shell cd $(src) && find display lib -name '*.h')
-
-always-$(CONFIG_DRM_HEADER_TEST) += \
- $(patsubst %.h,%.hdrtest, $(hdrtest-files))
-
-# Include the header twice to detect missing include guard.
-quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
- cmd_hdrtest = \
- $(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
- $(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
- touch $@
-
-$(obj)/%.hdrtest: $(src)/%.h FORCE
- $(call if_changed_dep,hdrtest)
diff --git a/include/drm/Makefile b/include/drm/Makefile
index a7bd15d2803e..ed0567a7956a 100644
--- a/include/drm/Makefile
+++ b/include/drm/Makefile
@@ -1,18 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
# Ensure drm headers are self-contained and pass kernel-doc
-hdrtest-files := \
+header-check-$(CONFIG_DRM_HEADER_TEST) += \
$(shell cd $(src) && find * -name '*.h' 2>/dev/null)
-
-always-$(CONFIG_DRM_HEADER_TEST) += \
- $(patsubst %.h,%.hdrtest, $(hdrtest-files))
-
-# Include the header twice to detect missing include guard.
-quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
- cmd_hdrtest = \
- $(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
- $(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
- touch $@
-
-$(obj)/%.hdrtest: $(src)/%.h FORCE
- $(call if_changed_dep,hdrtest)
--
2.39.5
Powered by blists - more mailing lists