Skip to content

Some kernel-doc fixes

Mauro Carvalho Chehab linux-doc linux-kbuild lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 2 repliesIn review
  2. v2 posting 2/23 patches 2 repliesSuperseded
  3. v2 posting 1/21 patch 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches5 repliesSuperseded

Changes in v3 from the cover letter

- Fix a trivial typo on patch 1;
- Added Akira's ack;

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3MAINTAINERS: update linux-doc entry to cover new Python scriptsMAINTAINERS+4 -10 replies
2/3docs: kerneldoc.py: simplify exception handling logicDocumentation/sphinx/kerneldoc.py+45 -630 replies
3/3scripts: kernel-doc: prevent a KeyError when checking outputscripts/lib/kdoc/kdoc_files.py+4 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAkira YokosawaAndy Shevchenko
SeriesA-b
1/3A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] Some kernel-doc fixes

Hi Jon,

That's the third version of the kernel-doc fixup patch series.

It address the root cause why Sphinx logger was not working: there was a call there for logger.verbose(). According with:

https://www.sphinx-doc.org/en/master/extdev/logging.html

This is a valid call, but it doesn't verbose messages. Instead, it is crashing with modern Sphinx versions, causing the log to not work.

I got rid of it, replacing by logger.info(). I took the time to also address an issue pointed by Andy: not having the same log message placed everywhere. With such change, we can keep using Sphinx logger (which produces colored messages) inside kernel-doc classes.

With that, we have:

Patch 1: makes Lore and kernel-doc ML receive patches related
to kernel-doc.py and get_abi.py.
Patch 2: cleanup try/except logic and get rid of logger.verbose();
Patch 3: fix a KeyError when trying to acess data from non-existing files;

If you test just patch 1 on the top of next-20250516, you'll see the keyerror message (in red):

ERROR: Cannot find file ./drivers/gpio/gpiolib-acpi.c
ERROR: Cannot find file ./drivers/gpio/gpiolib-acpi.c
WARNING: kernel-doc './scripts/kernel-doc.py -rst -enable-lineno -export ./drivers/gpio/gpiolib-acpi.c' processing failed with: KeyError('./drivers/gpio/gpiolib-acpi.c')

And the script doesn't crash anymore. After patch 2, the try/except warning gets replaced by a proper message:

ERROR: Cannot find file ./drivers/gpio/gpiolib-acpi.c
ERROR: Cannot find file ./drivers/gpio/gpiolib-acpi.c
WARNING: No kernel-doc for file ./drivers/gpio/gpiolib-acpi.c

Please apply it to solve the issues that are reported by Stephen and Akira.

Regards,
Mauro

---

v3:
- Fix a trivial typo on patch 1;
- Added Akira's ack;

v2:
- Solved the root cause of not having Sphinx logs on kerneldoc.py.

Mauro Carvalho Chehab (3):
MAINTAINERS: update linux-doc entry to cover new Python scripts
docs: kerneldoc.py: simplify exception handling logic
scripts: kernel-doc: prevent a KeyError when checking output

 Documentation/sphinx/kerneldoc.py | 108 +++++++++++++-----------------
 MAINTAINERS                       |   5 +-
 scripts/lib/kdoc/kdoc_files.py    |   4 ++
 3 files changed, 53 insertions(+), 64 deletions(-)
Signature · 1 line
2.49.0