linux/tools/lib/python/kdoc
Omokefe Emmanuel Onanaroghene 2d72a4c098 docs: kdoc: parse context_lock_struct() as struct declaration
kernel-doc fails to parse struct declarations wrapped in
context_lock_struct(), e.g. struct debugfs_cancellation:

  include/linux/debugfs.h:245 ... error: Cannot parse struct or union!

Add a struct transform that expands context_lock_struct() to a plain
struct declaration, and apply the struct transforms to the whole
declaration before split_struct_proto(), matching what dump_var() and
dump_function() already do for their prototypes. The member-only
transform in dump_struct() is then redundant.

Add a regression test for the debugfs_cancellation declaration.

Fixes: 6e530e2e31 ("debugfs: Make debugfs_cancellation a context lock struct")
Signed-off-by: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20260925234054.128477-1-emmaonana18@gmail.com>
2026-09-29 16:59:29 -06:00
..
__init__.py
c_lex.py tools/lib: fix typos in comments 2026-09-07 10:37:58 -06:00
enrich_formatter.py docs: kdoc: enrich_formatter: Improve docstrings and comments 2026-01-23 11:37:38 -07:00
kdoc_files.py doc tools: better handle KBUILD_VERBOSE 2026-03-30 10:03:40 -06:00
kdoc_item.py docs: kdoc: better handle source when producing YAML output 2026-03-25 13:36:46 -06:00
kdoc_output.py docs: kdoc: fix troff output description typo 2026-07-15 10:51:27 -06:00
kdoc_parser.py docs: kdoc: parse context_lock_struct() as struct declaration 2026-09-29 16:59:29 -06:00
kdoc_re.py docs: kdoc_re: better represent long regular expressions 2026-03-22 15:10:40 -06:00
kdoc_yaml_file.py docs: kdoc_yaml_file: use a better name for the tests 2026-03-25 13:36:46 -06:00
latex_fonts.py docs: kdoc: latex_fonts: Improve docstrings and comments 2026-01-23 11:37:38 -07:00
parse_data_structs.py docs: kdoc: parse_data_structs: Improve docstrings and comments 2026-01-23 11:37:38 -07:00
python_version.py docs: kdoc: python_version: Improve docstrings and comments 2026-01-23 11:37:38 -07:00
xforms_lists.py docs: kdoc: parse context_lock_struct() as struct declaration 2026-09-29 16:59:29 -06:00