summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-10-14 13:51:36 +0100
committerMark Brown <broonie@kernel.org>2026-10-14 13:51:36 +0100
commitc57eea29e5e5d6f279e2a0f1a79607f5f565949d (patch)
tree762aa73ef56329cb6d683bd9222c11fb5a33c810 /tools/lib/python
parent47aebeec778302b00f80c4c916c8f88ed3782088 (diff)
parent8fdbd353e6928492fdc46c359aabd2bfb7630fba (diff)
downloadlinux-next-c57eea29e5e5d6f279e2a0f1a79607f5f565949d.tar.gz
linux-next-c57eea29e5e5d6f279e2a0f1a79607f5f565949d.zip
Merge branch 'docs-next' of git://git.lwn.net/linux.git
Diffstat (limited to 'tools/lib/python')
-rw-r--r--tools/lib/python/kdoc/c_lex.py2
-rw-r--r--tools/lib/python/kdoc/kdoc_parser.py11
-rw-r--r--tools/lib/python/kdoc/xforms_lists.py3
3 files changed, 10 insertions, 6 deletions
diff --git a/tools/lib/python/kdoc/c_lex.py b/tools/lib/python/kdoc/c_lex.py
index cb95f5172448..efbc23c01abd 100644
--- a/tools/lib/python/kdoc/c_lex.py
+++ b/tools/lib/python/kdoc/c_lex.py
@@ -68,7 +68,7 @@ class CToken():
MISMATCH = 255 #: an error indicator: should never happen in practice.
- # Dict to convert from an enum interger into a string.
+ # Dict to convert from an enum integer into a string.
_name_by_val = {v: k for k, v in dict(vars()).items() if isinstance(v, int)}
# Dict to convert from string to an enum-like integer value.
diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/kdoc_parser.py
index d9ad1ddc87dd..80d4245acd17 100644
--- a/tools/lib/python/kdoc/kdoc_parser.py
+++ b/tools/lib/python/kdoc/kdoc_parser.py
@@ -831,6 +831,13 @@ class KernelDoc:
#
source = source
proto = trim_private_members(proto)
+
+ #
+ # Expand macro-based declarations, like context_lock_struct(),
+ # into a plain struct/union declaration before splitting it,
+ # as dump_var() and dump_function() already do.
+ #
+ proto = self.xforms.apply("struct", proto)
struct_parts = self.split_struct_proto(proto)
if not struct_parts:
self.emit_msg(ln, f"{proto} error: Cannot parse struct or union!")
@@ -841,10 +848,6 @@ class KernelDoc:
self.emit_msg(ln, f"expecting prototype for {decl_type} {self.entry.identifier}. "
f"Prototype was for {decl_type} {declaration_name} instead")
return
- #
- # Go through the list of members applying all of our transformations.
- #
- members = self.xforms.apply("struct", members)
#
# Deal with embedded struct and union members, and drop enums entirely.
diff --git a/tools/lib/python/kdoc/xforms_lists.py b/tools/lib/python/kdoc/xforms_lists.py
index e792785a15ec..320f977c5bac 100644
--- a/tools/lib/python/kdoc/xforms_lists.py
+++ b/tools/lib/python/kdoc/xforms_lists.py
@@ -54,7 +54,7 @@ class CTransforms:
(CMatch("__attribute__"), ""),
#
- # Macro __struct_group() creates an union with an anonymous
+ # Macro __struct_group() creates a union with an anonymous
# and a non-anonymous struct, depending on the parameters. We only
# need one of those at kernel-doc, as we won't be documenting the same
# members twice.
@@ -63,6 +63,7 @@ class CTransforms:
(CMatch("struct_group_attr"), r"struct { \3+ };"),
(CMatch("struct_group_tagged"), r"struct { \3+ };"),
(CMatch("__struct_group"), r"struct { \4+ };"),
+ (CMatch("context_lock_struct"), r"struct \1"),
]
#: Transforms for function prototypes.