ad525x_dpot: add support for ADN2860 and AD528x pots
[safe/jmp/linux-2.6] / scripts / kernel-doc
index ea9f8a5..fcdfb24 100755 (executable)
@@ -13,8 +13,6 @@ use strict;
 ## This software falls under the GNU General Public License.     ##
 ## Please read the COPYING file for more information             ##
 
-# w.o. 03-11-2000: added the '-filelist' option.
-
 # 18/01/2001 -         Cleanups
 #              Functions prototyped as foo(void) same as foo()
 #              Stop eval'ing where we don't need to.
@@ -245,7 +243,7 @@ my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
 # could cause "use of undefined value" or other bugs.
 my ($function, %function_table, %parametertypes, $declaration_purpose);
 my ($type, $declaration_name, $return_type);
-my ($newsection, $newcontents, $prototype, $filelist, $brcount, %source_map);
+my ($newsection, $newcontents, $prototype, $brcount, %source_map);
 
 if (defined($ENV{'KBUILD_VERBOSE'})) {
        $verbose = "$ENV{'KBUILD_VERBOSE'}";
@@ -338,8 +336,6 @@ while ($ARGV[0] =~ m/^-(.*)/) {
        $verbose = 1;
     } elsif (($cmd eq "-h") || ($cmd eq "--help")) {
        usage();
-    } elsif ($cmd eq '-filelist') {
-           $filelist = shift @ARGV;
     } elsif ($cmd eq '-no-doc-sections') {
            $no_doc_sections = 1;
     }
@@ -1428,6 +1424,8 @@ sub dump_struct($$) {
        $nested =~ s/\/\*.*?\*\///gos;
        # strip kmemcheck_bitfield_{begin,end}.*;
        $members =~ s/kmemcheck_bitfield_.*?;//gos;
+       # strip attributes
+       $members =~ s/__aligned\s*\(\d+\)//gos;
 
        create_parameterlist($members, ';', $file);
        check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
@@ -1732,6 +1730,7 @@ sub dump_function($$) {
     $prototype =~ s/^noinline +//;
     $prototype =~ s/__devinit +//;
     $prototype =~ s/__init +//;
+    $prototype =~ s/__init_or_module +//;
     $prototype =~ s/^#\s*define\s+//; #ak added
     $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//;
 
@@ -1811,14 +1810,6 @@ if (open(SOURCE_MAP, "<.tmp_filelist.txt")) {
        close(SOURCE_MAP);
 }
 
-if ($filelist) {
-       open(FLIST,"<$filelist") or die "Can't open file list $filelist";
-       while(<FLIST>) {
-               chop;
-               process_file($_);
-       }
-}
-
 foreach (@ARGV) {
     chomp;
     process_file($_);
@@ -1852,10 +1843,17 @@ sub tracepoint_munge($) {
        my $tracepointname = 0;
        my $tracepointargs = 0;
 
-       if($prototype =~ m/TRACE_EVENT\((.*?),/) {
+       if ($prototype =~ m/TRACE_EVENT\((.*?),/) {
+               $tracepointname = $1;
+       }
+       if ($prototype =~ m/DEFINE_SINGLE_EVENT\((.*?),/) {
                $tracepointname = $1;
        }
-       if($prototype =~ m/TP_PROTO\((.*?)\)/) {
+       if ($prototype =~ m/DEFINE_EVENT\((.*?),(.*?),/) {
+               $tracepointname = $2;
+       }
+       $tracepointname =~ s/^\s+//; #strip leading whitespace
+       if ($prototype =~ m/TP_PROTO\((.*?)\)/) {
                $tracepointargs = $1;
        }
        if (($tracepointname eq 0) || ($tracepointargs eq 0)) {
@@ -1920,7 +1918,9 @@ sub process_state3_function($$) {
        if ($prototype =~ /SYSCALL_DEFINE/) {
                syscall_munge();
        }
-       if ($prototype =~ /TRACE_EVENT/) {
+       if ($prototype =~ /TRACE_EVENT/ || $prototype =~ /DEFINE_EVENT/ ||
+           $prototype =~ /DEFINE_SINGLE_EVENT/)
+       {
                tracepoint_munge($file);
        }
        dump_function($prototype, $file);
@@ -2014,6 +2014,8 @@ sub process_file($) {
        return;
     }
 
+    $. = 1;
+
     $section_counter = 0;
     while (<IN>) {
        if ($state == 0) {
@@ -2104,7 +2106,7 @@ sub process_file($) {
                $section = $newsection;
            } elsif (/$doc_end/) {
 
-               if ($contents ne "") {
+               if (($contents ne "") && ($contents ne "\n")) {
                    dump_section($file, $section, xml_escape($contents));
                    $section = $section_default;
                    $contents = "";