mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] kernel-doc: support for comma-separated members in structs and unions.
@ 2004-10-31 21:37 Alexey Dobriyan
  2004-11-01 18:53 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2004-10-31 21:37 UTC (permalink / raw)
  To: sam; +Cc: linux-kernel

Fix the following warnings

$ make sgmldocs
...
Warning(include/linux/skbuff.h:283): No description found for parameter 'len,data_len,mac_len,csum'
Warning(include/linux/skbuff.h:283): No description found for parameter 'local_df,cloned,pkt_type,ip_summed'
Warning(include/linux/skbuff.h:283): No description found for parameter 'protocol,security'
...
Warning(include/linux/skbuff.h:283): No description found for
parameter 'head,*data,*tail,*end'
...

by adding support for comma-separated members in structs and unions.

Signed-off-by: Alexey Dobriyan <adobriyan@mail.ru>

--- a/scripts/kernel-doc	2004-11-01 05:45:19.205305432 +0000
+++ b/scripts/kernel-doc	2004-11-01 05:57:59.562713536 +0000
@@ -105,10 +105,7 @@
 # enums and typedefs. Instead of the function name you must write the name 
 # of the declaration;  the struct/union/enum/typedef must always precede 
 # the name. Nesting of declarations is not supported. 
-# Use the argument mechanism to document members or constants. In 
-# structs and unions you must declare one member per declaration 
-# (comma-separated members are not allowed -  the parser does not support 
-# this).
+# Use the argument mechanism to document members or constants.
 # e.g.
 # /**
 #  * struct my_struct - short description
@@ -1318,22 +1315,40 @@
 	    $param = $1;
 	    $type = $arg;
 	    $type =~ s/([^\(]+\(\*)$param/$1/;
+	    push_parameter($param, $type, $file);
 	} else {
 	    # evil magic to get fixed array parameters to work
 	    $arg =~ s/(.+\s+)(.+)\[.*/$1* $2/;
-	    my @args = split('\s', $arg);
-	
-	    $param = pop @args;
-	    if ($param =~ m/^(\*+)(.*)/) {
-	        $param = $2;
-		push @args, $1;
-	    } 
-	    elsif ($param =~ m/(.*?)\s*:\s*(\d+)/) {
-	        $param = $1;
-	        push @args, ":$2";
+
+	    $arg =~ s/\s*:\s*/:/g;
+
+	    my @args = split('\s*,\s*', $arg);
+	    if ($args[0] =~ m/\*/) {
+		$args[0] =~ s/(\*+)\s*/ $1/;
+	    }
+	    my @first_arg = split('\s+', shift @args);
+	    unshift(@args, pop @first_arg);
+	    $type = join " ", @first_arg;
+
+	    foreach $param (@args) {
+		if ($param =~ m/^(\*+)\s*(.*)/) {
+		    push_parameter($2, "$type $1", $file);
+		}
+		elsif ($param =~ m/(.*?):(\d+)/) {
+		    push_parameter($1, "$type:$2", $file)
+		}
+		else {
+		    push_parameter($param, $type, $file);
+		}
 	    }
-	    $type = join " ", @args;
 	}
+    }
+}
+
+sub push_parameter($$$) {
+	my $param = shift;
+	my $type = shift;
+	my $file = shift;
 
 	if ($type eq "" && $param eq "...")
 	{
@@ -1362,7 +1377,6 @@
 
 	push @parameterlist, $param;
 	$parametertypes{$param} = $type;
-    }
 }
 
 ##


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] kernel-doc: support for comma-separated members in structs and unions.
  2004-10-31 21:37 [PATCH 1/3] kernel-doc: support for comma-separated members in structs and unions Alexey Dobriyan
@ 2004-11-01 18:53 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2004-11-01 18:53 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: sam, linux-kernel

On Mon, Nov 01, 2004 at 12:37:39AM +0300, Alexey Dobriyan wrote:
> Fix the following warningsA
Applied

	Sam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-01 17:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-31 21:37 [PATCH 1/3] kernel-doc: support for comma-separated members in structs and unions Alexey Dobriyan
2004-11-01 18:53 ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®