Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=884f2810b15b6bb489c9dca5013aafbea2f19fba Commit: 884f2810b15b6bb489c9dca5013aafbea2f19fba Parent: 1525dccbc248b87568f2477f1b2d417b69d418c3 Author: Borislav Petkov <[EMAIL PROTECTED]> AuthorDate: Tue May 8 00:29:05 2007 -0700 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Tue May 8 11:15:09 2007 -0700
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 <[EMAIL PROTECTED]> Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- scripts/kernel-doc | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c3a4854..c47eb31 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1456,7 +1456,16 @@ sub create_parameterlist($$$) { if ($args[0] =~ m/\*/) { $args[0] =~ s/(\*+)\s*/ $1/; } - my @first_arg = split('\s+', shift @args); + + my @first_arg; + if ($args[0] =~ /^(.*\s+)(.*?\[.*\].*)$/) { + shift @args; + push(@first_arg, split('\s+', $1)); + push(@first_arg, $2); + } else { + @first_arg = split('\s+', shift @args); + } + unshift(@args, pop @first_arg); $type = join " ", @first_arg; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html