lkml.org 
[lkml]   [2015]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
From
Subjectkernel-doc: Not stripped #define/#ifdef/#endif in enums
Date
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;


\
 
 \ /
  Last update: 2015-11-01 17:41    [W:0.059 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site