]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
scripts/kernel-doc: handle DECLARE_HASHTABLE
authorJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 1 Jul 2017 02:09:59 +0000 (19:09 -0700)
committerJonathan Corbet <corbet@lwn.net>
Mon, 3 Jul 2017 12:57:09 +0000 (06:57 -0600)
DECLARE_HASHTABLE needs similar handling to DECLARE_BITMAP
because otherwise kernel-doc assumes the member name is the
second, not first macro parameter.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/kernel-doc

index a26a5f2dce39431497bd430ab605dd061c98009c..c1ffd31ff4233228a71dd8cb0f84eb35be5bfe52 100755 (executable)
@@ -2189,6 +2189,8 @@ sub dump_struct($$) {
        $members =~ s/\s*CRYPTO_MINALIGN_ATTR//gos;
        # replace DECLARE_BITMAP
        $members =~ s/DECLARE_BITMAP\s*\(([^,)]+), ([^,)]+)\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos;
+       # replace DECLARE_HASHTABLE
+       $members =~ s/DECLARE_HASHTABLE\s*\(([^,)]+), ([^,)]+)\)/unsigned long $1\[1 << (($2) - 1)\]/gos;
 
        create_parameterlist($members, ';', $file);
        check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);