docs: kdoc: simplify the kerneldoc recognition code
authorJonathan Corbet <corbet@lwn.net>
Fri, 6 Jun 2025 16:34:33 +0000 (10:34 -0600)
committerJonathan Corbet <corbet@lwn.net>
Mon, 9 Jun 2025 20:37:17 +0000 (14:37 -0600)
commite76a1d2b2623e9f10e2ffd295ae2615bf3228561
treef1d276caa82006399b2d0ba97ca89170042a67f6
parent42592bd46dded5fab5af1d5e04c9b17cbb4bca6d
docs: kdoc: simplify the kerneldoc recognition code

process_name() looks for the first line of a kerneldoc comment.  It
contains two nearly identical regular expressions, the second of which only
catches six cases in the kernel, all of the form:

  define SOME_MACRO_NAME - description

Simply put the "define" into the regex and discard it, eliminating the loop
and the code to remove it specially.

Note that this still treats these defines as if they were functions, but
that's a separate issue.

There is no change in the generated output.

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