summaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorConchúr Navid <conchur@web.de>2015-11-08 10:52:00 +0100
committerJonathan Corbet <corbet@lwn.net>2015-11-20 16:14:10 -0700
commitb22b5a9ef5309287b86bac9eb47f17a12671b770 (patch)
tree1ae7f039eff250d7b83b458a96c6d8d840ec73df /scripts/kernel-doc
parent4468e21eed2dd7ee8dc91d94dbd2ccb0d291fb07 (diff)
downloadop-kernel-dev-b22b5a9ef5309287b86bac9eb47f17a12671b770.zip
op-kernel-dev-b22b5a9ef5309287b86bac9eb47f17a12671b770.tar.gz
kernel-doc: Fix parsing of DECLARE_BITMAP in struct
Some documented structures in the kernel use DECLARE_BITMAP to create arrays of unsigned longs to store information using the bitmap functions. These have to be replaced with a parsable version for kernel-doc. For example a simple input like /** * struct something - some test * @members: active members */ struct something { DECLARE_BITMAP(members, MAX_MEMBERS); }; resulted in parsing warnings like warning: No description found for parameter 'MAX_MEMBERS)' warning: Excess struct/union/enum/typedef member 'members' description in 'something' 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-xscripts/kernel-doc2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index f5c2971..9015b18 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1816,6 +1816,8 @@ sub dump_struct($$) {
$members =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//i;
$members =~ s/__aligned\s*\([^;]*\)//gos;
$members =~ s/\s*CRYPTO_MINALIGN_ATTR//gos;
+ # replace DECLARE_BITMAP
+ $members =~ s/DECLARE_BITMAP\s*\(([^,)]+), ([^,)]+)\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos;
create_parameterlist($members, ';', $file);
check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
OpenPOWER on IntegriCloud