[PATCH 0/3] Some small improvements for kernel-doc generation

From: Mauro Carvalho Chehab
Date: Fri Apr 25 2025 - 03:16:35 EST


Hi Jon,

This series contain 3 patches for kernel-doc:

Patch 1 creates a kernel doc class at the beginning of kerneldoc Sphinx
module and preserves it. With that, some caching is enabled;
Patch 2 fixes some permissions;
Patch 3 is mostly a cleanup patch to simplify a little bit the complex parser.

On my tests here, it runs about 10 seconds faster on my machine
and I didn't notice any regressions.

I guess there are still space to optimize the cache, but I don't want to
do too much optimization on a single series.

Please also notice that I didn't check the amount of memory that it is
now consumed storing the entire kernel-doc data on a dictionary.
I assume it is not that much, as I can still compile docs on my 16GB
laptop.

Mauro Carvalho Chehab (3):
docs: Sphinx: kerneldoc: only initialize kernel-doc classes once
scripts/lib/kdoc: change mode to 0644
scripts/lib/kdoc/kdoc_parser.py: move kernel entry to a class

Documentation/sphinx/kerneldoc.py | 23 ++-
scripts/lib/kdoc/kdoc_output.py | 0
scripts/lib/kdoc/kdoc_parser.py | 277 ++++++++++++++++--------------
scripts/lib/kdoc/kdoc_re.py | 0
4 files changed, 162 insertions(+), 138 deletions(-)
mode change 100755 => 100644 scripts/lib/kdoc/kdoc_output.py
mode change 100755 => 100644 scripts/lib/kdoc/kdoc_parser.py
mode change 100755 => 100644 scripts/lib/kdoc/kdoc_re.py

--
2.49.0