docs: kdoc: rework the handling of SPECIAL_SECTION
authorJonathan Corbet <corbet@lwn.net>
Sat, 21 Jun 2025 20:35:09 +0000 (14:35 -0600)
committerJonathan Corbet <corbet@lwn.net>
Wed, 25 Jun 2025 17:30:26 +0000 (11:30 -0600)
commite65d54e19149601b96a19790ee9ba9ed04c59abe
tree14efd9faec860941b5af54cda09834a2bf0254b6
parent99327067e1974e83cd8a60cf8445ce49086de46e
docs: kdoc: rework the handling of SPECIAL_SECTION

Move the recognition of this state to when we enter it, rather than when we
exit, eliminating some twisty logic along the way.

Some changes in output do result from this shift, generally for kerneldoc
comments that do not quite fit the format.  See, for example,
struct irqdomain.  As far as I can tell, the new behavior is more correct
in each case.

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250621203512.223189-7-corbet@lwn.net
scripts/lib/kdoc/kdoc_parser.py