summaryrefslogtreecommitdiff
path: root/scripts/lib/kdoc/kdoc_parser.py
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2025-09-04 14:27:00 -0600
committerJonathan Corbet <corbet@lwn.net>2025-09-18 10:19:53 -0600
commitf853e83006ab39c3dafe085a488c14bb46906601 (patch)
tree2eaba89c4a248c3272ce3607daa23358a8b2c1dd /scripts/lib/kdoc/kdoc_parser.py
parente214cca38f1f35d42e63e990c610c96f993343c4 (diff)
docs: kdoc: remove a single-use variable
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>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
-rw-r--r--scripts/lib/kdoc/kdoc_parser.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
index 2118c20b3056..b25c8d80b965 100644
--- a/scripts/lib/kdoc/kdoc_parser.py
+++ b/scripts/lib/kdoc/kdoc_parser.py
@@ -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), ' '),