scripts: kernel-doc: support private / public marking for enums
authorJakub Kicinski <kuba@kernel.org>
Wed, 21 Jun 2023 22:35:25 +0000 (15:35 -0700)
committerJonathan Corbet <corbet@lwn.net>
Tue, 4 Jul 2023 14:30:49 +0000 (08:30 -0600)
Enums benefit from private markings, too. For netlink attribute
name enums always end with a pair of __$n_MAX and $n_MAX members.
Documenting them feels a bit tedious.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20230621223525.2722703-1-kuba@kernel.org>

scripts/kernel-doc

index 2486689ffc7b47a5f987a31cd88d7cd6e24ce2a6..66b5548978995d976343583db31ee7a3255ab98c 100755 (executable)
@@ -1301,6 +1301,9 @@ sub dump_enum($$) {
     my $file = shift;
     my $members;
 
+    # ignore members marked private:
+    $x =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gosi;
+    $x =~ s/\/\*\s*private:.*}/}/gosi;
 
     $x =~ s@/\*.*?\*/@@gos;    # strip comments.
     # strip #define macros inside enums