aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bbpetkov@yahoo.de>2007-05-08 03:29:05 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:09 -0400
commit884f2810b15b6bb489c9dca5013aafbea2f19fba (patch)
tree24db99adbe273fea1c2ce695ebde49fb00be9e51
parent1525dccbc248b87568f2477f1b2d417b69d418c3 (diff)
kernel-doc: handle arrays with arithmetic expressions as initializers
In a different approach here's a patch that handles the special case of composite arithmetic expressions in array size initializers. With it, prior to pushing the split strings on the @first_arg array, I split the keywords before the array name as before and then keep the array name along with the subscript expression as a single whole element which gets pushed last. In this manner, kernel-doc produces correct output without removing whitespaces which makes the array subscripts unreadable in the docs. Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-xscripts/kernel-doc11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index c3a4854e5ee9..c47eb31d604c 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1456,7 +1456,16 @@ sub create_parameterlist($$$) {
1456 if ($args[0] =~ m/\*/) { 1456 if ($args[0] =~ m/\*/) {
1457 $args[0] =~ s/(\*+)\s*/ $1/; 1457 $args[0] =~ s/(\*+)\s*/ $1/;
1458 } 1458 }
1459 my @first_arg = split('\s+', shift @args); 1459
1460 my @first_arg;
1461 if ($args[0] =~ /^(.*\s+)(.*?\[.*\].*)$/) {
1462 shift @args;
1463 push(@first_arg, split('\s+', $1));
1464 push(@first_arg, $2);
1465 } else {
1466 @first_arg = split('\s+', shift @args);
1467 }
1468
1460 unshift(@args, pop @first_arg); 1469 unshift(@args, pop @first_arg);
1461 $type = join " ", @first_arg; 1470 $type = join " ", @first_arg;
1462 1471