Skip to content

Commit f853e83

Browse files
author
Jonathan Corbet
committed
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>
1 parent e214cca commit f853e83

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

scripts/lib/kdoc/kdoc_parser.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,11 @@
7676
# Here begins a long set of transformations to turn structure member prefixes
7777
# and macro invocations into something we can parse and generate kdoc for.
7878
#
79-
struct_attribute = KernRe(r"__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)",
80-
flags=re.I | re.S, cache=False)
8179
struct_args_pattern = r'([^,)]+)'
8280

8381
struct_prefixes = [
8482
# Strip attributes
85-
(struct_attribute, ' '),
83+
(KernRe(r"__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)", flags=re.I | re.S, cache=False), ' '),
8684
(KernRe(r'\s*__aligned\s*\([^;]*\)', re.S), ' '),
8785
(KernRe(r'\s*__counted_by\s*\([^;]*\)', re.S), ' '),
8886
(KernRe(r'\s*__counted_by_(le|be)\s*\([^;]*\)', re.S), ' '),

0 commit comments

Comments
 (0)