Commit 890c78c2 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

kernel-doc: allow more whitespace in macros

Allow macros that are annotated with kernel-doc to contain whitespace
between the '#' and "define".  It's valid and being used, so allow it.
Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7eea5b89
...@@ -1648,7 +1648,7 @@ sub dump_function($$) { ...@@ -1648,7 +1648,7 @@ sub dump_function($$) {
$prototype =~ s/^noinline +//; $prototype =~ s/^noinline +//;
$prototype =~ s/__devinit +//; $prototype =~ s/__devinit +//;
$prototype =~ s/__init +//; $prototype =~ s/__init +//;
$prototype =~ s/^#define\s+//; #ak added $prototype =~ s/^#\s*define\s+//; #ak added
$prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//;
# Yes, this truly is vile. We are looking for: # Yes, this truly is vile. We are looking for:
...@@ -1764,13 +1764,13 @@ sub process_state3_function($$) { ...@@ -1764,13 +1764,13 @@ sub process_state3_function($$) {
$x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line
if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#define/)) { if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#\s*define/)) {
# do nothing # do nothing
} }
elsif ($x =~ /([^\{]*)/) { elsif ($x =~ /([^\{]*)/) {
$prototype .= $1; $prototype .= $1;
} }
if (($x =~ /\{/) || ($x =~ /\#define/) || ($x =~ /;/)) { if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) {
$prototype =~ s@/\*.*?\*/@@gos; # strip comments. $prototype =~ s@/\*.*?\*/@@gos; # strip comments.
$prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's. $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
$prototype =~ s@^\s+@@gos; # strip leading spaces $prototype =~ s@^\s+@@gos; # strip leading spaces
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment