]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
docs: kdoc: remove a useless empty capture group
authorJonathan Corbet <corbet@lwn.net>
Fri, 5 Sep 2025 22:30:48 +0000 (16:30 -0600)
committerJonathan Corbet <corbet@lwn.net>
Thu, 18 Sep 2025 16:19:53 +0000 (10:19 -0600)
The is_define_proto case in dump_function() uses a regex with an empty
capture group - () - that has no use; just take it out.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/lib/kdoc/kdoc_parser.py

index decd127df82e009d8f8206c048a38af9c59c7310..f9be5414244d9b7e943cf46134dc477719b1c898 100644 (file)
@@ -972,11 +972,11 @@ class KernelDoc:
         found = False
 
         if is_define_proto:
-            r = KernRe(r'^()(' + name + r')\s+')
+            r = KernRe(r'^(' + name + r')\s+')
 
             if r.search(prototype):
                 return_type = ''
-                declaration_name = r.group(2)
+                declaration_name = r.group(1)
                 func_macro = True
 
                 found = True