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 $@
        $(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
 
   -man                 Output troff manual page format. This is the default.
   -rst                 Output reStructuredText format.
   -text                        Output plain text format.
+  -none                        Do not output documentation, only warnings.
 
 Output selection (mutually exclusive):
   -export              Only output documentation for symbols that have been
        $output_mode = "gnome";
        @highlights = @highlights_gnome;
        $blankline = $blankline_gnome;
+    } elsif ($cmd eq "-none") {
+       $output_mode = "none";
     } elsif ($cmd eq "-module") { # not needed for XML, inherits from calling document
        $modulename = shift @ARGV;
     } elsif ($cmd eq "-function") { # to only output specific functions
     }
 }
 
+
+## none mode output functions
+
+sub output_function_none(%) {
+}
+
+sub output_enum_none(%) {
+}
+
+sub output_typedef_none(%) {
+}
+
+sub output_struct_none(%) {
+}
+
+sub output_blockhead_none(%) {
+}
+
 ##
 # generic output function for all types (function, struct/union, typedef, enum);
 # calls the generated, variable output_ function name based on
        }
     }
     if ($initial_section_counter == $section_counter) {
-       print STDERR "${file}:1: warning: no structured comments found\n";
+       if ($output_mode ne "none") {
+           print STDERR "${file}:1: warning: no structured comments found\n";
+       }
        if (($output_selection == OUTPUT_INCLUDE) && ($show_not_found == 1)) {
            print STDERR "    Was looking for '$_'.\n" for keys %function_table;
        }