kernel-doc: allow more whitespace in macros

Previous thread: i7300_idle: Fix compile warning CONFIG_I7300_IDLE_IOAT_CHANNEL not defined by Linux Kernel Mailing List on Sunday, October 26, 2008 - 4:59 pm. (1 message)

Next thread: docbooks: fix fatal filename errors by Linux Kernel Mailing List on Sunday, October 26, 2008 - 4:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Sunday, October 26, 2008 - 4:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=890c78...
Commit:     890c78c2d681a8dc89c78eb9177990cad3a77dc3
Parent:     7eea5b897eb6bbb79d7e6e398f4fbb61fcee57c7
Author:     Randy Dunlap <randy.dunlap@oracle.com>
AuthorDate: Sat Oct 25 17:06:43 2008 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Sun Oct 26 16:32:09 2008 -0700

    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 <randy.dunlap@oracle.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 scripts/kernel-doc |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 44ee94d..a53e2fc 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1648,7 +1648,7 @@ sub dump_function($$) {
     $prototype =~ s/^noinline +//;
     $prototype =~ s/__devinit +//;
     $prototype =~ s/__init +//;
-    $prototype =~ s/^#define\s+//; #ak added
+    $prototype =~ s/^#\s*define\s+//; #ak added
     $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//;
 
     # Yes, this truly is vile.  We are looking for:
@@ -1764,13 +1764,13 @@ sub process_state3_function($$) {
 
     $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
     }
     elsif ($x =~ /([^\{]*)/) {
 	$prototype .= $1;
     }
-    if (($x =~ /\{/) || ($x =~ /\#define/) || ($x =~ /;/)) {
+    if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) {
 	$prototype =~ s@/\*.*?\*/@@gos;	# strip comments.
 	$prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
 	$prototype =~ s@^\s+@@gos; # strip leading ...
Previous thread: i7300_idle: Fix compile warning CONFIG_I7300_IDLE_IOAT_CHANNEL not defined by Linux Kernel Mailing List on Sunday, October 26, 2008 - 4:59 pm. (1 message)

Next thread: docbooks: fix fatal filename errors by Linux Kernel Mailing List on Sunday, October 26, 2008 - 4:59 pm. (1 message)