* [PATCH] kernel-doc: allow more whitespace in macros
@ 2008-10-26 0:06 Randy Dunlap
0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2008-10-26 0:06 UTC (permalink / raw)
To: torvalds; +Cc: lkml
From: Randy Dunlap <randy.dunlap@oracle.com>
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>
---
scripts/kernel-doc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- linux-2.6.28-rc1-git1.orig/scripts/kernel-doc
+++ linux-2.6.28-rc1-git1/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 spaces
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-10-26 0:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-26 0:06 [PATCH] kernel-doc: allow more whitespace in macros Randy Dunlap
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.