On Thu, 14 Aug 2025 at 18:13, Peter Maydell <peter.mayd...@linaro.org> wrote: > > We last synced our copy of kerneldoc with Linux back in 2020. In the > interim, upstream has entirely rewritten the script in Python, and > the new Python version is split into a main script plus some > libraries in the kernel's scripts/lib/kdoc. > > Import all these files. These are the versions as of kernel commit > 0cc53520e68be, with no local changes. > > We use the same lib/kdoc/ directory as the kernel does here, so we > can avoid having to edit the top-level script just to adjust a > pathname, even though it is probably not the naming we would have > picked if this was a purely QEMU script.
> scripts/kernel-doc.py | 325 ++++++ > scripts/lib/kdoc/kdoc_files.py | 291 ++++++ > scripts/lib/kdoc/kdoc_item.py | 42 + > scripts/lib/kdoc/kdoc_output.py | 749 ++++++++++++++ > scripts/lib/kdoc/kdoc_parser.py | 1669 +++++++++++++++++++++++++++++++ > scripts/lib/kdoc/kdoc_re.py | 270 +++++ We could alternatively put the whole thing into a subdir, e.g.: scripts/kdoc/kernel-doc.py scripts/kdoc/lib/kdoc/kdoc_files.py scripts/kdoc/lib/kdoc/kdoc_item.py etc if we don't like having lib/ at the top level of our scripts/ directory. The thing the script cares about is that the relative path from kernel-doc.py to the lib/kdoc files is the same. thanks -- PMM