]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kbuild: move warnings about linux/export.h from W=1 to W=2
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 12 Jun 2025 16:08:48 +0000 (01:08 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 15 Jun 2025 15:41:40 +0000 (00:41 +0900)
This hides excessive warnings, as nobody builds with W=2.

Fixes: a934a57a42f6 ("scripts/misc-check: check missing #include <linux/export.h> when W=1")
Fixes: 7d95680d64ac ("scripts/misc-check: check unnecessary #include <linux/export.h> when W=1")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Makefile
scripts/misc-check

index 35e6e5240c61a8a329011929fcd0352b881dccdc..69c53498241576542f4f6f66bb844527b6e541db 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1832,12 +1832,9 @@ rustfmtcheck: rustfmt
 # Misc
 # ---------------------------------------------------------------------------
 
-# Run misc checks when ${KBUILD_EXTRA_WARN} contains 1
 PHONY += misc-check
-ifneq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
 misc-check:
        $(Q)$(srctree)/scripts/misc-check
-endif
 
 all: misc-check
 
index a74450e799d1b6794896352a9b1c0375d50f3229..84f08da17b2c0508b5c2471a6ffb2ab7e36592a4 100755 (executable)
@@ -62,6 +62,15 @@ check_unnecessary_include_linux_export_h () {
        xargs -r printf "%s: warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present\n" >&2
 }
 
-check_tracked_ignored_files
-check_missing_include_linux_export_h
-check_unnecessary_include_linux_export_h
+case "${KBUILD_EXTRA_WARN}" in
+*1*)
+       check_tracked_ignored_files
+       ;;
+esac
+
+case "${KBUILD_EXTRA_WARN}" in
+*2*)
+       check_missing_include_linux_export_h
+       check_unnecessary_include_linux_export_h
+       ;;
+esac