]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
docs: kdoc: remove a single-use variable
authorJonathan Corbet <corbet@lwn.net>
Thu, 4 Sep 2025 20:27:00 +0000 (14:27 -0600)
committerJonathan Corbet <corbet@lwn.net>
Thu, 18 Sep 2025 16:19:53 +0000 (10:19 -0600)
struct_attribute is only used once, so just put its value there directly
and drop the name.

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

index 2118c20b30568f5c045e1eece3f1ee153064cf6c..b25c8d80b96590876d4251f5309cd094d5ef3332 100644 (file)
@@ -76,13 +76,11 @@ doc_begin_func = KernRe(str(doc_com) +                      # initial " * '
 # Here begins a long set of transformations to turn structure member prefixes
 # and macro invocations into something we can parse and generate kdoc for.
 #
-struct_attribute = KernRe(r"__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)",
-                          flags=re.I | re.S, cache=False)
 struct_args_pattern = r'([^,)]+)'
 
 struct_prefixes = [
     # Strip attributes
-    (struct_attribute, ' '),
+    (KernRe(r"__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)", flags=re.I | re.S, cache=False), ' '),
     (KernRe(r'\s*__aligned\s*\([^;]*\)', re.S), ' '),
     (KernRe(r'\s*__counted_by\s*\([^;]*\)', re.S), ' '),
     (KernRe(r'\s*__counted_by_(le|be)\s*\([^;]*\)', re.S), ' '),