| b211a306 | 06-Feb-2026 |
Randy Dunlap <rdunlap@infradead.org> |
docs: kdoc_parser: allow __exit in function prototypes
Handle functions that are marked with __exit to prevent warnings:
Documentation/networking/iucv:35: ../net/iucv/iucv.c:1918: WARNING: Error in
docs: kdoc_parser: allow __exit in function prototypes
Handle functions that are marked with __exit to prevent warnings:
Documentation/networking/iucv:35: ../net/iucv/iucv.c:1918: WARNING: Error in declarator or parameters Invalid C declaration: Expecting "(" in parameters. [error at 12] void __exit iucv_exit (void) ------------^
Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260206065440.2412185-1-rdunlap@infradead.org>
show more ...
|
| 330367bd | 23-Jan-2026 |
Jonathan Corbet <corbet@lwn.net> |
Merge branch 'mauro' into docs-mw
Mauro's work to include documentation from our Python modules. His cover letter follows:
This is an extended version of: https://lore.kernel.org/linux-doc/cov
Merge branch 'mauro' into docs-mw
Mauro's work to include documentation from our Python modules. His cover letter follows:
This is an extended version of: https://lore.kernel.org/linux-doc/cover.1768488832.git.mchehab+huawei@kernel.org/
It basically adds everything we currently have inside libs/tool/python to "tools" book inside documentation.
This version should be independent of the other series yet to be merged, (including the jobserver one).
The vast amount of changes here are docstring cleanups and additions. They mainly consists on:
- ensuring that every phrase will end with a period, making it uniform along all files; - cleaning ups to better uniform docstrings; - variable descriptions now use "#:" markup, as it allows autodoc to add them inside the documentation; - added some missing docstrings; - some new blank lines at comments to make ReST syntax parser happy; - add a couple of sphinx markups (mainly, code blocks).
Most of those are minor changes, affecting only comments.
It also has one patch per libarary type, adding them to docs.
For kernel-doc, I did the cleanups first, as there is one code block inside tools/lib/python/kdoc/latex_fonts.py that would cause a Sphinx crash without such markups.
The series actually starts with 3 fixes:
- avoid "*" markups on indexes with deep> 3 to override text - a variable rename to stop abusing doctree name - don't rely on cwd to get Documentation/ location
patch 4 adds support to document scripts either at: - tools/ - scripts/
patch 5 contains a CSS to better display autodoc html output.
For those who want to play with documentation, documenting a python file is very simple. All it takes is to use:
.. automodule:: lib.python.<dir+name>
Usually, we add a couple of control members to it to adjust the desired documentation scope (add/remove members, showing class inheritance, showing members that currently don't have docstrings, etc). That's why we're using:
.. automodule:: lib.python.kdoc.enrich_formatter :members: :show-inheritance: :undoc-members:
(and similar) inside tools/kdoc*.rst.
autodoc allows filtering in/out members, file docstrings, etc.
It also allows documenting just some members or functions with directives like:
..autofunction: ..automember:
Sphinx also has a helper script to generate .rst files with documentation:
$ sphinx-apidoc -o foobar tools/lib/python/
which can be helpful to discover what should be documented, although changes are needed to use what it produces.
show more ...
|
| 33220c1f | 19-Jan-2026 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kdoc: python_version: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
docs: kdoc: python_version: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <2153afaeb496e1bb8d3cc318fff26c3f99d99486.1768838938.git.mchehab+huawei@kernel.org>
show more ...
|
| 7ef684c9 | 19-Jan-2026 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kdoc: enrich_formatter: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.or
docs: kdoc: enrich_formatter: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <55ec8b896fe00529d326859cd094230fb5a2cd30.1768838938.git.mchehab+huawei@kernel.org>
show more ...
|
| e68c84b9 | 19-Jan-2026 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kdoc: parse_data_structs: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.
docs: kdoc: parse_data_structs: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <76ead85b4c13a8038180a792e270c3691d26cd25.1768838938.git.mchehab+huawei@kernel.org>
show more ...
|
| b0b88915 | 19-Jan-2026 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kdoc_re: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-b
docs: kdoc_re: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <14a12a43144d52345bfd405d0401d246f0885acf.1768838938.git.mchehab+huawei@kernel.org>
show more ...
|
| 245f1ab2 | 19-Jan-2026 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kdoc_output: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-o
docs: kdoc_output: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <ac03bf776f0929bbe822cd8269f2a31e275b8d6b.1768838938.git.mchehab+huawei@kernel.org>
show more ...
|
| 50206750 | 19-Jan-2026 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kdoc_parser: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-o
docs: kdoc_parser: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <b6aabe25b45e9751885becd544a4db82dbe11ff2.1768838938.git.mchehab+huawei@kernel.org>
show more ...
|
| f40bba94 | 19-Jan-2026 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kdoc_item: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off
docs: kdoc_item: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <65a7c6bb318e7a8cbf5c115903d507568099151a.1768838938.git.mchehab+huawei@kernel.org>
show more ...
|
| 8d08c7c6 | 19-Jan-2026 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kdoc_files: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-of
docs: kdoc_files: Improve docstrings and comments
In preparation to document kernel-doc module, improve its documentation.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <75d58878ad6f83f24f1c0ce9e04301a000ecbaa3.1768838938.git.mchehab+huawei@kernel.org>
show more ...
|
| 292eca31 | 19-Jan-2026 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kdoc: fix logic to handle unissued warnings
Changeset 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently discarded") didn't properly addressed the missing messages behavior, as it wa
docs: kdoc: fix logic to handle unissued warnings
Changeset 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently discarded") didn't properly addressed the missing messages behavior, as it was calling directly python logger low-level function, instead of using the expected method to emit warnings.
Basically, there are two methods to log messages:
- self.config.log.warning() - This is the raw level to emit a warning. It just writes the a message at stderr, via python logging, as it is initialized as:
self.config.log = logging.getLogger("kernel-doc")
- self.config.warning() - This is where we actually consider a message as a warning, properly incrementing error count.
Due to that, several parsing error messages are internally considered as success, causing -Werror to not work on such messages.
While here, ensure that the last ignored entry will also be handled by adding an extra check at the end of the parse handler.
Fixes: 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently discarded") Closes: https://lore.kernel.org/linux-doc/20260112091053.00cee29a@foz.lan/ Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <95109a6585171da4d6900049deaa2634b41ee743.1768823489.git.mchehab+huawei@kernel.org>
show more ...
|
| aaacd70f | 16-Dec-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: kernel-doc.rst: Parse DEFINE_ macros without prefixes
Currently, the logic for vars require a type DEFINE_foo();
where type is usually "static".
Make the logic more generic.
Reported-by: R
docs: kernel-doc.rst: Parse DEFINE_ macros without prefixes
Currently, the logic for vars require a type DEFINE_foo();
where type is usually "static".
Make the logic more generic.
Reported-by: Randy Dunlap <rdunlap@infradead.org> Closes: https://lore.kernel.org/linux-doc/e1dad7e4-a0ca-4be6-a33c-97b75175c12f@infradead.org/ Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <be16e087cbc065fbd041fb6d6f8fa5cf0426cca5.1765894964.git.mchehab+huawei@kernel.org>
show more ...
|
| bdd1cf87 | 16-Dec-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
kernel-doc: add support to handle DEFINE_ variables
Improve the parser and output plugin to work with macros, adding support for the common pattern of using DEFINE_* to create variables.
Signed-off
kernel-doc: add support to handle DEFINE_ variables
Improve the parser and output plugin to work with macros, adding support for the common pattern of using DEFINE_* to create variables.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <757a45100cfc493984574ff780aa9d90506eecb4.1765894964.git.mchehab+huawei@kernel.org>
show more ...
|
| 5f88f44d | 24-Nov-2025 |
Randy Dunlap <rdunlap@infradead.org> |
docs: kdoc: various fixes for grammar, spelling, punctuation
Correct grammar, spelling, and punctuation in comments, strings, print messages, logs.
Change two instances of two spaces between words
docs: kdoc: various fixes for grammar, spelling, punctuation
Correct grammar, spelling, and punctuation in comments, strings, print messages, logs.
Change two instances of two spaces between words to just one space.
codespell was used to find misspelled words.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20251124041011.3030571-1-rdunlap@infradead.org>
show more ...
|
| 18182f97 | 26-Nov-2025 |
Randy Dunlap <rdunlap@infradead.org> |
docs: kdoc_parser: use '@' for Excess enum value
kdoc is looking for "@value" here, so use that kind of string in the warning message. The "%value" can be confusing.
This changes: Warning: drivers/
docs: kdoc_parser: use '@' for Excess enum value
kdoc is looking for "@value" here, so use that kind of string in the warning message. The "%value" can be confusing.
This changes: Warning: drivers/net/wireless/mediatek/mt76/testmode.h:92 Excess enum value '%MT76_TM_ATTR_TX_PENDING' description in 'mt76_testmode_attr'
to this: Warning: drivers/net/wireless/mediatek/mt76/testmode.h:92 Excess enum value '@MT76_TM_ATTR_TX_PENDING' description in 'mt76_testmode_attr'
Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20251126061752.3497106-1-rdunlap@infradead.org>
show more ...
|
| 2006f468 | 27-Nov-2025 |
Randy Dunlap <rdunlap@infradead.org> |
docs: kdoc_parser: add data/function attributes to ignore
Recognize and ignore __rcu (in struct members), __private (in struct members), and __always_unused (in function parameters) to prevent kerne
docs: kdoc_parser: add data/function attributes to ignore
Recognize and ignore __rcu (in struct members), __private (in struct members), and __always_unused (in function parameters) to prevent kernel-doc warnings:
Warning: include/linux/rethook.h:38 struct member 'void (__rcu *handler' not described in 'rethook' Warning: include/linux/hrtimer_types.h:47 Invalid param: enum hrtimer_restart (*__private function)(struct hrtimer *) Warning: security/ipe/hooks.c:81 function parameter '__always_unused' not described in 'ipe_mmap_file' Warning: security/ipe/hooks.c:109 function parameter '__always_unused' not described in 'ipe_file_mprotect'
There are more of these (in compiler_types.h, compiler_attributes.h) that can be added as needed.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20251127063117.150384-1-rdunlap@infradead.org>
show more ...
|