Skip to content

Commit 4b44595

Browse files
jmbergsravnborg
authored andcommitted
kernel-doc: process functions, not DOC:
This flag is necessary for the next patch for docproc to output only the functions and not DOC: sections when a function list is requested. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
1 parent b112e0f commit 4b44595

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎scripts/kernel-doc‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@ use strict;
4646
# Note: This only supports 'c'.
4747

4848
# usage:
49-
# kernel-doc [ -docbook | -html | -text | -man ]
49+
# kernel-doc [ -docbook | -html | -text | -man ] [ -no-doc-sections ]
5050
# [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile
5151
# or
5252
# [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile
5353
#
5454
# Set output format using one of -docbook -html -text or -man. Default is man.
5555
#
56+
# -no-doc-sections
57+
# Do not output DOC: sections
58+
#
5659
# -function funcname
5760
# If set, then only generate documentation for the given function(s) or
5861
# DOC: section titles. All other functions and DOC: sections are ignored.
@@ -211,7 +214,7 @@ my $blankline_text = "";
211214

212215

213216
sub usage {
214-
print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man ]\n";
217+
print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man ] [ -no-doc-sections ]\n";
215218
print " [ -function funcname [ -function funcname ...] ]\n";
216219
print " [ -nofunction funcname [ -nofunction funcname ...] ]\n";
217220
print " c source file(s) > outputfile\n";
@@ -225,6 +228,7 @@ if ($#ARGV==-1) {
225228

226229
my $verbose = 0;
227230
my $output_mode = "man";
231+
my $no_doc_sections = 0;
228232
my %highlights = %highlights_man;
229233
my $blankline = $blankline_man;
230234
my $modulename = "Kernel API";
@@ -329,6 +333,8 @@ while ($ARGV[0] =~ m/^-(.*)/) {
329333
usage();
330334
} elsif ($cmd eq '-filelist') {
331335
$filelist = shift @ARGV;
336+
} elsif ($cmd eq '-no-doc-sections') {
337+
$no_doc_sections = 1;
332338
}
333339
}
334340

@@ -380,6 +386,10 @@ sub dump_doc_section {
380386
my $name = shift;
381387
my $contents = join "\n", @_;
382388

389+
if ($no_doc_sections) {
390+
return;
391+
}
392+
383393
if (($function_only == 0) ||
384394
( $function_only == 1 && defined($function_table{$name})) ||
385395
( $function_only == 2 && !defined($function_table{$name})))

0 commit comments

Comments
 (0)