[PATCH v2 2/2] kbuild: enable kernel-doc -Wall for W=2

From: Johannes Berg
Date: Tue Jun 06 2023 - 04:57:35 EST


From: Johannes Berg <johannes.berg@xxxxxxxxx>

For W=2, we can enable more kernel-doc warnings,
such as missing return value descriptions etc.

Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---
v2: - create command-line instead of exporting an
env var, as suggested by Masahiro Yamada
---
scripts/Makefile.build | 1 +
1 file changed, 1 insertion(+)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 90bb5badb0e9..920eeee2cb6e 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -102,6 +102,7 @@ endif

ifneq ($(KBUILD_EXTRA_WARN),)
cmd_checkdoc = $(srctree)/scripts/kernel-doc -none \
+ $(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \
$(if $(KDOC_WALL), -Wall) \
$(if $(KDOC_WRETURN), -Wreturn) \
$(if $(KDOC_WSHORT_DESC), -Wshort-desc) \
--
2.40.1