Skip to content

Commit 890c78c

Browse files
rddunlaptorvalds
authored andcommitted
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: Randy Dunlap <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7eea5b8 commit 890c78c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/kernel-doc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,7 @@ sub dump_function($$) {
16481648
$prototype =~ s/^noinline +//;
16491649
$prototype =~ s/__devinit +//;
16501650
$prototype =~ s/__init +//;
1651-
$prototype =~ s/^#define\s+//; #ak added
1651+
$prototype =~ s/^#\s*define\s+//; #ak added
16521652
$prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//;
16531653

16541654
# Yes, this truly is vile. We are looking for:
@@ -1764,13 +1764,13 @@ sub process_state3_function($$) {
17641764

17651765
$x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line
17661766

1767-
if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#define/)) {
1767+
if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#\s*define/)) {
17681768
# do nothing
17691769
}
17701770
elsif ($x =~ /([^\{]*)/) {
17711771
$prototype .= $1;
17721772
}
1773-
if (($x =~ /\{/) || ($x =~ /\#define/) || ($x =~ /;/)) {
1773+
if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) {
17741774
$prototype =~ s@/\*.*?\*/@@gos; # strip comments.
17751775
$prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
17761776
$prototype =~ s@^\s+@@gos; # strip leading spaces

0 commit comments

Comments
 (0)