From 3a025e1d1c2ea42fa497c9c6b21c284e0f69e28b Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Mon, 20 Nov 2017 10:40:40 -0800 Subject: Add optional check for bad kernel-doc comments Implement a '-none' output mode for kernel-doc which will only output warning messages, and suppresses the warning message about there being no kernel-doc in the file. If the build has requested additional warnings, automatically check all .c files. This patch does not check .h files. Enabling the warning by default would add about 1300 warnings, so it's default off for now. People who care can use this to check they didn't break the docs and maybe we'll get all the warnings fixed and be able to enable this check by default in the future. Signed-off-by: Matthew Wilcox Signed-off-by: Jonathan Corbet --- scripts/Makefile.build | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts/Makefile.build') diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 2e3a10e79ca9..aceac0ba0745 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -108,6 +108,10 @@ ifneq ($(KBUILD_CHECKSRC),0) endif endif +ifneq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),) + cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $< ; +endif + # Do section mismatch analysis for each module/built-in.o ifdef CONFIG_DEBUG_SECTION_MISMATCH cmd_secanalysis = ; scripts/mod/modpost $@ @@ -289,6 +293,7 @@ define rule_cc_o_c $(call echo-cmd,checksrc) $(cmd_checksrc) \ $(call cmd_and_fixdep,cc_o_c) \ $(cmd_modversions_c) \ + $(cmd_checkdoc) \ $(call echo-cmd,objtool) $(cmd_objtool) \ $(call echo-cmd,record_mcount) $(cmd_record_mcount) endef -- cgit v1.2.3-55-g7522