X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fkernel-doc;h=ff787e6ff8edcbef0edc7fbfaef7f3d088f930a0;hb=04f64b5756872b474d9429e3b6987ada10bb8012;hp=74c2f9db2aac06586f25a1397c94de5325a2b509;hpb=b4de123a0bc4a3f0c90899864d51299628729952;p=linux-2.6-omap-h63xx.git diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 74c2f9db2aa..ff787e6ff8e 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -5,7 +5,7 @@ use strict; ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## ## Copyright (C) 2000, 1 Tim Waugh ## ## Copyright (C) 2001 Simon Huggins ## -## Copyright (C) 2005-2007 Randy Dunlap ## +## Copyright (C) 2005-2008 Randy Dunlap ## ## ## ## #define enhancements by Armin Kuster ## ## Copyright (c) 2000 MontaVista Software, Inc. ## @@ -247,6 +247,10 @@ my ($function, %function_table,%parametertypes,$declaration_purpose); my ($type,$declaration_name,$return_type); my ($newsection,$newcontents,$prototype,$filelist, $brcount, %source_map); +if (defined($ENV{'KBUILD_VERBOSE'})) { + $verbose = "$ENV{'KBUILD_VERBOSE'}"; +} + # Generated docbook code is inserted in a template at a point where # docbook v3.1 requires a non-zero sequence of RefEntry's; see: # http://www.oasis-open.org/docbook/documentation/reference/html/refentry.html @@ -362,6 +366,7 @@ foreach my $pattern (keys %highlights) { # dumps section contents to arrays/hashes intended for that purpose. # sub dump_section { + my $file = shift; my $name = shift; my $contents = join "\n", @_; @@ -375,6 +380,10 @@ sub dump_section { $parameterdescs{$name} = $contents; } else { # print STDERR "other section '$name' = '$contents'\n"; + if (defined($sections{$name}) && ($sections{$name} ne "")) { + print STDERR "Error(${file}:$.): duplicate section name '$name'\n"; + ++$errors; + } $sections{$name} = $contents; push @sectionlist, $name; } @@ -384,6 +393,7 @@ sub dump_section { # dump DOC: section after checking that it should go out # sub dump_doc_section { + my $file = shift; my $name = shift; my $contents = join "\n", @_; @@ -395,7 +405,7 @@ sub dump_doc_section { ( $function_only == 1 && defined($function_table{$name})) || ( $function_only == 2 && !defined($function_table{$name}))) { - dump_section $name, $contents; + dump_section($file, $name, $contents); output_blockhead({'sectionlist' => \@sectionlist, 'sections' => \%sections, 'module' => $modulename, @@ -1393,7 +1403,7 @@ sub dump_struct($$) { my $members = $3; # ignore embedded structs or unions - $members =~ s/{.*?}//g; + $members =~ s/{.*}//g; # ignore members marked private: $members =~ s/\/\*.*?private:.*?public:.*?\*\///gos; @@ -1546,7 +1556,9 @@ sub create_parameterlist($$$) { push_parameter($2, "$type $1", $file); } elsif ($param =~ m/(.*?):(\d+)/) { - push_parameter($1, "$type:$2", $file) + if ($type ne "") { # skip unnamed bit-fields + push_parameter($1, "$type:$2", $file) + } } else { push_parameter($param, $type, $file); @@ -1631,6 +1643,7 @@ sub dump_function($$) { $prototype =~ s/^__always_inline +//; $prototype =~ s/^noinline +//; $prototype =~ s/__devinit +//; + $prototype =~ s/__init +//; $prototype =~ s/^#define\s+//; #ak added $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; @@ -1919,7 +1932,7 @@ sub process_file($) { print STDERR "Warning(${file}:$.): contents before sections\n"; ++$warnings; } - dump_section($section, xml_escape($contents)); + dump_section($file, $section, xml_escape($contents)); $section = $section_default; } @@ -1936,10 +1949,15 @@ sub process_file($) { } elsif (/$doc_end/) { if ($contents ne "") { - dump_section($section, xml_escape($contents)); + dump_section($file, $section, xml_escape($contents)); $section = $section_default; $contents = ""; } + # look for doc_com + + doc_end: + if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') { + print STDERR "Warning(${file}:$.): suspicious ending line: $_"; + ++$warnings; + } $prototype = ""; $state = 3; @@ -1950,7 +1968,7 @@ sub process_file($) { # @parameter line to signify start of description if ($1 eq "" && ($section =~ m/^@/ || $section eq $section_context)) { - dump_section($section, xml_escape($contents)); + dump_section($file, $section, xml_escape($contents)); $section = $section_default; $contents = ""; } else { @@ -1970,7 +1988,7 @@ sub process_file($) { } elsif ($state == 4) { # Documentation block if (/$doc_block/) { - dump_doc_section($section, xml_escape($contents)); + dump_doc_section($file, $section, xml_escape($contents)); $contents = ""; $function = ""; %constants = (); @@ -1988,7 +2006,7 @@ sub process_file($) { } elsif (/$doc_end/) { - dump_doc_section($section, xml_escape($contents)); + dump_doc_section($file, $section, xml_escape($contents)); $contents = ""; $function = ""; %constants = ();