diff options
author | Conchúr Navid <conchur@web.de> | 2015-11-08 12:45:23 +0300 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2015-11-21 02:13:33 +0300 |
commit | 8a9260aa96b5112856a8bfdbf80984bfbcb4003f (patch) | |
tree | 0681ad11d59b00cde96d04c31ed41415e28c405f /scripts/kernel-doc | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) | |
download | linux-8a9260aa96b5112856a8bfdbf80984bfbcb4003f.tar.xz |
kernel-doc: Fix stripping of #define in enums
The regex to strip single line #define's in enumerations depends on the
fact that the defines are still stored on separate lines. But the
surrounding code already removed newlines and replaced them with
semicolons.
For example a simple input like
/**
* enum flags - test flags
* @flag1: first flag
* @flag2: second flag
* @flag3: third flag
* @flag4: fourth flag
*/
enum flags {
flag1 = BIT(0),
flag2 = BIT(1),
#define flags_small (flag1 | flag2)
flag3 = BIT(2),
flag4 = BIT(3),
#define flags_big (flag2 | flag3)
};
resulted in parsing warnings like
warning: Enum value '#define flags_small (flag1 | flag2);flag3 = BIT(2)' not described in enum 'flags'
warning: Enum value '#define flags_big (flag2 | flag3);' not described in enum 'flags'
Signed-off-by: Conchúr Navid <conchur@web.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-x | scripts/kernel-doc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 125b906cd1d4..8313b49b6cd0 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1844,7 +1844,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; |