Hi,
 
just noticed that #define in kernel-doc are not correctly stripped anymore from 
enums. Here is my patch

 
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1830,7 +1830,7 @@ sub dump_enum($$) {
     my $file = shift;
 
     $x =~ s@/\*.*?\*/@@gos;    # strip comments.
-    $x =~ s/^#\s*define\s+.*$//; # strip #define macros inside enums
+    $x =~ s@#\s*define\s+[^;]*;@@gos; # strip #define macros inside enums
 
     if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
        $declaration_name = $1;

 
But there are also places in the kernel where #ifdef/#endif is used inside 
enums. So maybe this should also be stripped:

--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1830,7 +1830,8 @@ sub dump_enum($$) {
     my $file = shift;
 
     $x =~ s@/\*.*?\*/@@gos;    # strip comments.
-    $x =~ s/^#\s*define\s+.*$//; # strip #define macros inside enums
+    # strip #define/#ifdef/#endif macros inside enums
+    $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
 
     if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
        $declaration_name = $1;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to