Skip to contentSkip to conversation

docs: parse-headers: Fix script name and stale Makefile reference

PATCH Applied Karl Mehltretter 3 participants 3 messages Sep 5 – Sep 7 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: parse-headers: Fix script name and stale Makefile reference

The script is tools/docs/parse-headers.py, not parse_headers.py, and its FILE_RULES argument is optional. Commit 8a298579cdfc ("scripts:
sphinx-build-wrapper: get rid of uapi/media Makefile") removed the Makefile the text points to as an example; the cross-references are now generated by the kernel-include directive, so point to a file that uses it.

Fixes d69a03a97a2d ("docs: doc-guide: parse-headers.rst update its documentation")
Fixes 8a298579cdfc ("scripts: sphinx-build-wrapper: get rid of uapi/media Makefile")
Assisted-by LLM
---
 Documentation/doc-guide/parse-headers.rst | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
Documentation/doc-guide/parse-headers.rst +8 -7
index a7bb01ff04eb..eb36c92e9a06 100644
@@ -8,26 +8,27 @@ between the code and the documentation. Adding cross-references for
 userspace API files has an additional advantage: Sphinx will generate warnings
 if a symbol is not found at the documentation. That helps to keep the
 uAPI documentation in sync with the Kernel changes.
-The :ref:`parse_headers.py <parse_headers>` provides a way to generate such
-cross-references. It has to be called via Makefile, while building the
-documentation. Please see ``Documentation/userspace-api/media/Makefile`` for an example
-about how to use it inside the Kernel tree.
+The :ref:`parse-headers.py <parse_headers>` provides a way to generate such
+cross-references. During the documentation build, the same parser is used by
+the ``kernel-include`` directive with the ``:generate-cross-refs:`` option.
+Please see ``Documentation/userspace-api/media/cec/cec-header.rst`` for an
+example about how to use it inside the Kernel tree.
 
 .. _parse_headers:
 
-tools/docs/parse_headers.py
+tools/docs/parse-headers.py
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 NAME
 ****
 
-parse_headers.py - parse a C file, in order to identify functions, structs,
+parse-headers.py - parse a C file, in order to identify functions, structs,
 enums and defines and create cross-references to a Sphinx book.
 
 USAGE
 *****
 
-parse-headers.py [-h] [-d] [-t] ``FILE_IN`` ``FILE_OUT`` ``FILE_RULES``
+parse-headers.py [-h] [-d] [-t] ``FILE_IN`` ``FILE_OUT`` [``FILE_RULES``]
 
 SYNOPSIS
 ********
Signature · 1 line
2.53.0
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Karl Mehltretter

The script is tools/docs/parse-headers.py, not parse_headers.py, and its FILE_RULES argument is optional. Commit 8a298579cdfc ("scripts:
sphinx-build-wrapper: get rid of uapi/media Makefile") removed the Makefile the text points to as an example; the cross-references are now generated by the kernel-include directive, so point to a file that uses it.

Fixes d69a03a97a2d ("docs: doc-guide: parse-headers.rst update its documentation")
Fixes 8a298579cdfc ("scripts: sphinx-build-wrapper: get rid of uapi/media Makefile")
Assisted-by LLM

I would like to see documentation for kernel-include added to Documentation/doc-guide/kernel-doc.rst or doc-guide/parse-headers.rst. I'm surprised that it's there already.

Thanks.

Quoted 43 lines
---
 Documentation/doc-guide/parse-headers.rst | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
Documentation/doc-guide/parse-headers.rst +8 -7
index a7bb01ff04eb..eb36c92e9a06 100644
@@ -8,26 +8,27 @@ between the code and the documentation. Adding cross-references for
 userspace API files has an additional advantage: Sphinx will generate warnings
 if a symbol is not found at the documentation. That helps to keep the
 uAPI documentation in sync with the Kernel changes.
-The :ref:`parse_headers.py <parse_headers>` provides a way to generate such
-cross-references. It has to be called via Makefile, while building the
-documentation. Please see ``Documentation/userspace-api/media/Makefile`` for an example
-about how to use it inside the Kernel tree.
+The :ref:`parse-headers.py <parse_headers>` provides a way to generate such
+cross-references. During the documentation build, the same parser is used by
+the ``kernel-include`` directive with the ``:generate-cross-refs:`` option.
+Please see ``Documentation/userspace-api/media/cec/cec-header.rst`` for an
+example about how to use it inside the Kernel tree.
 
 .. _parse_headers:
 
-tools/docs/parse_headers.py
+tools/docs/parse-headers.py
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 NAME
 ****
 
-parse_headers.py - parse a C file, in order to identify functions, structs,
+parse-headers.py - parse a C file, in order to identify functions, structs,
 enums and defines and create cross-references to a Sphinx book.
 
 USAGE
 *****
 
-parse-headers.py [-h] [-d] [-t] ``FILE_IN`` ``FILE_OUT`` ``FILE_RULES``
+parse-headers.py [-h] [-d] [-t] ``FILE_IN`` ``FILE_OUT`` [``FILE_RULES``]
 
 SYNOPSIS
 ********
Signature · 1 line
~Randy
maintainer Applied
#2 lore raw
In reply to Karl Mehltretter
Quoted 7 lines · Karl Mehltretter

The script is tools/docs/parse-headers.py, not parse_headers.py, and its FILE_RULES argument is optional. Commit 8a298579cdfc ("scripts:
sphinx-build-wrapper: get rid of uapi/media Makefile") removed the Makefile the text points to as an example; the cross-references are now generated by the kernel-include directive, so point to a file that uses it.

Quoted 7 lines
Fixes d69a03a97a2d ("docs: doc-guide: parse-headers.rst update its documentation")
Fixes 8a298579cdfc ("scripts: sphinx-build-wrapper: get rid of uapi/media Makefile")
Assisted-by LLM
---
 Documentation/doc-guide/parse-headers.rst | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Applied, thanks.

jon