Commit Graph

1381889 Commits

Author SHA1 Message Date
Jonathan Corbet
00fa9bc4e9 docs: kdoc: remove redundant comment stripping in dump_typedef()
By the time we get here, comments have long since been stripped out; there
is no need to do it again.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:54 -06:00
Jonathan Corbet
999a642d7e docs: kdoc: remove some dead code in dump_typedef()
The regex in this block of code makes no sense, and a quick test shows that
it never matches anything; simply delete the code.

No output changes.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
3dff54410e docs: kdoc: final dump_function() cleanups
Add some more comments to dump_function(), add some comments, and trim out
an unneeded duplicate output_declaration() call.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
370f430527 docs: kdoc: consolidate some of the macro-processing logic
The logic to handle macros is split in dump_function(); bring it all
together into a single place and add a comment saying what's going on.
Remove the unneeded is_define_proto variable, and tighten up the code
a bit.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
ff1f2af341 docs: kdoc: Simplify the dump_function() prototype regexes
The regexes for the parsing of function prototypes were more complicated
than they needed to be and difficult to understand -- at least, I spent a
fair amount of time bashing my head against them.  Simplify them, and add
some documentation comments as well.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
08b5228cf4 docs: kdoc: remove a useless empty capture group
The is_define_proto case in dump_function() uses a regex with an empty
capture group - () - that has no use; just take it out.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
fee63c8f10 docs: kdoc: remove a couple of spurious regex characters
The "name" regex in dump_function() includes both the tilde and colon
characters, but neither has any place in function prototypes.  Remove the
characters, after which the regex simplifies to "\w+"

No output changes.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
a2752f8c63 doc: kdoc: unify transform handling
Both functions and structs are passed through a set of regex-based
transforms, but the two were structured differently, despite being the same
thing.  Create a utility function to apply transformations and use it in
both cases.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
4c232a81b0 docs: kdoc: move the function transform patterns out of dump_function()
Move these definitions to file level, where they are executed once, and
don't clutter the function itself.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
f853e83006 docs: kdoc: remove a single-use variable
struct_attribute is only used once, so just put its value there directly
and drop the name.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
e214cca38f docs: kdoc: tighten up the push_parameter() no-type case
The handling of untyped parameters involved a number of redundant tests;
restructure the code to remove them and be more compact.

No output changes.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Jonathan Corbet
8b00d6fe96 docs: kdoc: trim __cacheline_group_* with the other annotations
The special case for __cacheline_group_begin/end() can be handled by just
adding another pattern to the struct_prefixes, eliminating the need for a
special case in push_parameter().

One change is that these annotations no longer appear in the rendered
output, just like all the other annotations that we clean out.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-09-18 10:19:53 -06:00
Akira Yokosawa
1e9ddbb2cd docs: Pull LKMM documentation into dev-tools book
Currently, LKMM docs are not included in any of kernel documentation
books.

Commit e40573a43d ("docs: put atomic*.txt and memory-barriers.txt
into the core-api book") covered plain-text docs under Documentation/
by using the "include::" directive along with the ":literal:" option.

As LKMM docs are not under Documentation/, the same approach would not
work due to the directive's restriction.

As a matter of fact, kernel documentation has an extended directive
by the name of "kernel-include::", which loosens such restriction and
accepts any files under the kernel source tree.

Rather than moving LKMM docs around, use the latter and pull them into
the dev-tools book next to KCSAN.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <7ce84a93-5cbc-420e-894a-06a0372c52ab@gmail.com>
2025-09-16 10:12:02 -06:00
Akiyoshi Kurita
9946f34452 docs: w1: ds2482: fix typo in buses
Correct a spelling mistake in ds2482.rst
("busses" -> "buses").

No functional change.

Signed-off-by: Akiyoshi Kurita <weibu@redadmin.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20250913173413.951378-1-weibu@redadmin.org>
2025-09-16 10:00:57 -06:00
Taimoor Zaeem
5089ec0bb1 Documentation: staging: fix spelling error in remoteproc.rst
Fix typo 'implementors' to 'implementers' in remote processor framework
documentation.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <CANQcFN1s_iM8p5tYNz3Q_WyZki6Aw9_3HyoKwyoCVA9JeqG0eA@mail.gmail.com>
2025-09-16 09:55:54 -06:00
Jonathan Corbet
00d95fcc4d docs: kdoc: handle the obsolescensce of docutils.ErrorString()
The ErrorString() and SafeString() docutils functions were helpers meant to
ease the handling of encodings during the Python 3 transition.  There is no
real need for them after Python 3.6, and docutils 0.22 removes them,
breaking the docs build

Handle this by just injecting our own one-liner version of ErrorString(),
and removing the sole SafeString() call entirely.

Reported-by: Zhixu Liu <zhixu.liu@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <87ldmnv2pi.fsf@trenco.lwn.net>
2025-09-15 17:24:06 -06:00
Jonathan Corbet
944df7a314 docs: update the guidance for Link: tags
As stated definitively by Linus, the use of Link: tags should be limited to
situations where there is additional useful information to be found at the
far end of the link.  Update our documentation to reflect that policy, and
to remove the suggestion for a Git hook to add those tags automatically.

Link: https://lore.kernel.org/all/CAHk-=wh5AyuvEhNY9a57v-vwyr7EkPVRUKMPwj92yF_K0dJHVg@mail.gmail.com/
Cc: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <87segwyc3p.fsf@trenco.lwn.net>
2025-09-15 17:22:38 -06:00
Konstantin Ryabitsev
f44a29784f Documentation: update maintainer-pgp-guide for latest best practices
Freshen up the maintainer PGP guide:

- Bump minimum GnuPG version requirement from 2.2 to 2.4, since 2.2 is
  no longer maintained
- All major hardware tokens now support Curve25519, so remove outdated
  ECC support callouts
- Update hardware device recommendations (Nitrokey Pro 2 -> Nitrokey 3)
- Broaden backup media terminology (USB thumb drive -> external media)
- Update wording to follow vale's linter recommendations
- Various minor wording improvements for clarity

Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Reviewed-by: Paul Barker <paul@pbarker.dev>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20250902-pgp-guide-updates-v1-1-62ac7312d3f9@linuxfoundation.org>
2025-09-09 13:43:55 -06:00
Jakub Kicinski
dc896f853e docs: submitting-patches: adjust Fixes definition slightly
Every now and then people send stylistic patches and use Fixes
purely to refer to a commit which added the ugly or unnecessary
code. Reword the docs about Fixes.

It should hopefully be enough to lead with the word "bug"
rather than "issue". We can add more verbiage later, tho, let's
try the word swap first. I always feel like the more words the
smaller the chance someone will actually read the docs.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20250904144533.2146576-1-kuba@kernel.org>
2025-09-09 13:42:37 -06:00
Jonathan Corbet
2d0dbf6e04 Merge branch 'renames' into docs-mw
From Vegard Nossum:

When we rename an .rst file, that also changes the URL for the document
at https://docs.kernel.org/ and results in a 404, which can be anonying
for people who bookmark URLs and/or follow links from search engines
and old changelogs and emails.

In order to be able to fearlessly rename individual documentation files
and reorganize Documentation/, add two scripts:

- tools/docs/gen-renames.py : use git to figure out which .rst files
  have been renamed

- tools/docs/gen-redirects.py : actually generate .html stubs for the
  locations, redirecting to the new locations

The reason for splitting this into two is that trawling git history is
slightly slow (on the order of 20-30 seconds on my laptop) whereas just
generating the HTML files is very fast. This also allows us to cache
the historical renames in Documentation/.renames.txt or add manual
fixups as needed.
2025-09-09 13:40:35 -06:00
Vegard Nossum
f2c2f64900 docs: add tools/docs/gen-redirects.py
Add a new script and a new documentation 'make' target,
htmldocs-redirects.

This will generate HTML stub files in the HTML documentation output
directory that redirect the browser to the new path.

Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Suggested-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20250905144608.577449-4-vegard.nossum@oracle.com>
2025-09-09 13:37:16 -06:00
Vegard Nossum
4b6fba4643 docs: add Documentation/.renames.txt
This is the result of running:

  scripts/documentation-gen-renames.py --rev v6.17-rc3 > Documentation/.renames.txt

This file records renames in the Documentation/ directory so that we
can use it to quickly generate HTML redirects from removed paths.

Suggested-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20250905144608.577449-3-vegard.nossum@oracle.com>
2025-09-09 13:37:16 -06:00
Vegard Nossum
2f1c96018b docs: add tools/docs/gen-renames.py
Add a new script that wraps git to trawl the repository history for
renames of .rst files in the Documentation/ directory.

Example usage:

  tools/docs/gen-renames.py --rev v6.17-rc3 > Documentation/.renames.txt

The output format is simply:

  <old path> SPACE <new path> NEWLINE

where neither <old path> nor <new path> contain the Documentation/
prefix or the .rst suffix. The file is sorted alphabetically.

We can suggest rerunning the script for future renames (and squash the
resulting change) or rerun it periodically to keep the file up to date.

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20250905144608.577449-2-vegard.nossum@oracle.com>
2025-09-09 13:37:16 -06:00
Bagas Sanjaya
f874abea20 Documentation: w1: Fix SPDX comment syntax on masters and slaves toctree index
Commit e9bb627561 ("docs: w1: convert to ReST and add to the kAPI
group of docs") converts 1-Wire docs to reST alongside with SPDX
comment, yet the comment is written in one dot as opposed to two in
order to be recognized as comment directive, which spills it into
htmldocs output. This issue is partially fixed in d8fb03e1ea ("docs:
w1: Fix SPDX-License-Identifier syntax") as it only touches top-level w1
toctree.

Do the same fix on masters and slaves toctrees.

Fixes: e9bb627561 ("docs: w1: convert to ReST and add to the kAPI group of docs")
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20250909022142.18007-1-bagasdotme@gmail.com>
2025-09-09 12:57:07 -06:00
Baruch Siach
7e5a0fe4e8 doc: filesystems: proc: remove stale information from intro
Most of the information in the first paragraph of the
Introduction/Credits section is outdated.

Documentation update suggestions should go to documentation maintainers
listed in MAINTAINERS. Remove misleading contact information.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/cb4987a16ed96ee86841aec921d914bd44249d0b.1756294647.git.baruch@tkos.co.il
2025-09-03 16:04:43 -06:00
Zenghui Yu
0059f3b82f docs: admin-guide: Fix typo in nfsroot.rst
There is an obvious mistake in nfsroot.rst where pxelinux was wrongly
written as pxeliunx. Fix it.

Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250827144738.43361-1-zenghui.yu@linux.dev
2025-09-03 16:00:03 -06:00
Vegard Nossum
0df41b1b94 docs: sphinx: remove SPDX/copyright comments from HTML output
Use Jinja2 comments instead of HTML comments for the SPDX and copyright
lines. This prevents them from appearing in the HTML output, which was
never the intention; the HTML output has its own copyright line at the
bottom of the document.

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250830170808.3911151-1-vegard.nossum@oracle.com
2025-09-03 15:50:51 -06:00
Harshit Mogalapalli
3f65aa8ede Documentation: dev-tools: Fix a typo in autofdo documentation
Use "cat /proc/cpuinfo" instead of "cat proc/cpuinfo".

Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250831151118.1274826-1-harshit.m.mogalapalli@oracle.com
2025-09-03 15:44:14 -06:00
Ranganath V N
a4c2ff6e50 Documentation: Fix spelling mistakes
Corrected a few spelling mistakes to improve the readability.

Signed-off-by: Ranganath V N <vnranganath.20@gmail.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250902193822.6349-1-vnranganath.20@gmail.com
2025-09-03 15:35:52 -06:00
Ryan Chung
b65988af71 tracing: fix grammar error in debugging.rst
Signed-off-by: Ryan Chung <seokwoo.chung130@gmail.com>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250831101736.11519-3-seokwoo.chung130@gmail.com
2025-09-03 15:31:48 -06:00
Ryan Chung
d5958c8a09 tracing: rephrase for clearer documentation
Signed-off-by: Ryan Chung <seokwoo.chung130@gmail.com>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250831101736.11519-2-seokwoo.chung130@gmail.com
2025-09-03 15:31:30 -06:00
Mauro Carvalho Chehab
118e54633c docs: kernel_include.py: drop some old behavior
The old behavior is not using anymore, so let's drop it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/00cdf3cbe2481aac875c543ded14b5eacfe071ec.1756732363.git.mchehab+huawei@kernel.org
2025-09-01 07:33:59 -06:00
Mauro Carvalho Chehab
8dbb1779ae docs: kernel_include.py: fix an issue when O= is used
As reported by Stephen, building docs with O= is now
broken. Fix it by ensuring that it will seek files under
Kernel source tree.

The original logic was defined to accept including files
under Documentation/output. The new logic doesn't need it
anymore for media, but it might still be useful to preserve
the previous behavior. So, I ended preserving it.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20250901142639.4de35a11@canb.auug.org.au/
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/da91980ce42f31730dc982920167b2757b9d2769.1756732363.git.mchehab+huawei@kernel.org
2025-09-01 07:33:59 -06:00
Mauro Carvalho Chehab
d90e7b5640 docs: conf.py: drop xindy rule
The rule as-is is wrong, as it was inverted. Besides that, after
retest building all repos with suggested LaTeX packages given
by sphinx-pre-install, I was unable to reproduce the issues
I saw with xindy in the past.

So, let's just drop. If anyone reports issues with xindy, we
may need to readd, but at the right way, e.g. {options}{pkgname}.

Reported-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/83068bc31839e7095f1f408e49658362d467797e.1756123459.git.mchehab+huawei@kernel.org
2025-08-29 16:45:09 -06:00
Bagas Sanjaya
ec1a37468f Documentation: sharedsubtree: Convert notes to note directive
While a few of the notes are already in reST syntax, others are left
intact (inconsistent). Convert them to reST syntax too.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250819061254.31220-6-bagasdotme@gmail.com
2025-08-29 16:40:01 -06:00
Bagas Sanjaya
b293fd55a1 Documentation: sharedsubtree: Align text
The docs make heavy use of lists. As it is currently written, these
generate a lot of unnecessary hanging indents since these are not
semantically meant to be definition lists by accident.

Align text to trim these indents.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250819061254.31220-5-bagasdotme@gmail.com
2025-08-29 16:40:01 -06:00
Bagas Sanjaya
570924bf17 Documentation: sharedsubtree: Don't repeat lists with explanation
Don't repeat lists only mentioning the items when a corresponding list
with item's explanations suffices.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250819061254.31220-4-bagasdotme@gmail.com
2025-08-29 16:40:01 -06:00
Bagas Sanjaya
a8886b42d5 Documentation: sharedsubtree: Use proper enumerator sequence for enumerated lists
Sphinx does not recognize mixed-letter sequences (e.g. 2a) as enumerator
for enumerated lists. As such, lists that use such sequences end up as
definition lists instead.

Use proper enumeration sequences for this purpose.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250819061254.31220-3-bagasdotme@gmail.com
2025-08-29 16:40:01 -06:00
Bagas Sanjaya
69c6739d67 Documentation: sharedsubtree: Format remaining of shell snippets as literal code blcoks
Fix formatting inconsistency of shell snippets by wrapping the remaining
of them in literal code blocks.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250819061254.31220-2-bagasdotme@gmail.com
2025-08-29 16:40:00 -06:00
Mallikarjun Thammanavar
7d1c5e52ec docs: fix spelling and grammar in atomic_writes
Fix minor spelling and grammatical issues in the ext4 atomic_writes
documentation.

Signed-off-by: Mallikarjun Thammanavar <mallikarjunst09@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250819124604.8995-1-mallikarjunst09@gmail.com
2025-08-29 16:32:17 -06:00
Vivek Alurkar
ddfaddc277 Fix typo in RAID arrays documentation
Changed "write-throuth" to "write-through".

Signed-off-by: Vivek Alurkar <primalkenja@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250821051622.8341-2-primalkenja@gmail.com
2025-08-29 16:29:18 -06:00
Alperen Aksu
ba653158f4 Documentation/filesystems/xfs: Fix typo error
Fixed typo error in referring to the section's headline
Fixed to correct spelling of "mapping"

Signed-off-by: Alperen Aksu <aksulperen@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250821131404.25461-1-aksulperen@gmail.com
2025-08-29 16:11:19 -06:00
Jonathan Corbet
c67a9f492c Merge branch 'mauro' into docs-mw
Another build series from Mauro:

The goal of this series is to drop one of the most ancient and ugliest
hack from the documentation build system. Before migrating to Sphinx,
the media subsystem already had a very comprehensive uAPI book, together
with a build time system to detect and point for any documentation gaps.

When migrating to Sphinx, we ported the logic to a Perl script
(parse-headers.pl) and Markus came up with a Sphinx extension
(kernel_include.py). We also added some files to control how parse-headers
produce results, and a Makefile.

At the initial Sphinx versions (1.4.1 if I recall correctly), when
a new symbol is added to videodev2.h, a new warning were
produced at documentatiion time, it the patchset didn't have
the corresponding documentation path.

While kernel-include is generic, the only user at the moment is the media
subsystem.

This series gets rid of the Python script, replacing it by a command
line script and a class. The parse header class can optionally be used by
kernel-include to produce an enriched code that will contain cross-references.

As the other conversions, it starts with a bug-compatible version of
parse-headers, but the subsequent patches add more functionalities and
fix bugs.

It should be noticed that modern of Sphinx disabled the cross-reference
warnings. So, at the next series, I'll be re-adding it in a controlled way
(e.g. just for the references from kernel-include that has an special
argument).

The script also supports now generating a "toc" output, which will be used
at the next series.
2025-08-29 15:58:48 -06:00
Mauro Carvalho Chehab
aebcc3009e docs: sphinx: drop parse-headers.pl
Now that we have a replacement in place, drop the old version.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/d3a5397df44e53b02fa62f782d1e7ce6e08ed04f.1755872208.git.mchehab+huawei@kernel.org
2025-08-29 15:54:43 -06:00
Mauro Carvalho Chehab
8a298579cd scripts: sphinx-build-wrapper: get rid of uapi/media Makefile
Now that kernel-include directive supports parsing data
structs directly, we can finally get rid of the horrible hack
we added to support parsing media uAPI symbols.

As a side effect, Documentation/output doesn't have anymore
media auto-generated .rst files on it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/5dbb257a4b283697271c9c7b8f4713857e8191c8.1755872208.git.mchehab+huawei@kernel.org
2025-08-29 15:54:43 -06:00
Mauro Carvalho Chehab
a49adfab49 docs: kernel_include.py: document all supported parameters
As we're actually a fork of Sphinx Include, update its
docstring to contain the documentation for the actual
implemented parameters.

Let's use :param: for parameters, as defined at:
https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/f193160889a2dc296b4df2cc7ebc9934d717ccef.1755872208.git.mchehab+huawei@kernel.org
2025-08-29 15:54:43 -06:00
Mauro Carvalho Chehab
428c1d3511 docs: kernel_include.py: remove Include class inheritance
While the original code came from the Sphinx Include class,
such class is monolithic: it has only one function that does
everything, and 3 variables that are used:

	- required_arguments
	- optional_arguments
	- option_spec

So, basically those are the only members that remain from
the original class, but hey! Those are the same vars that every
other Sphinx directive extension has to define!

In summary, keeping inheritance here doesn't make much sense.

Worse than that, kernel-include doesn't support the current set
of options that the original Include class has, but it also
has its own set of options.

So, let's fill in the argument vars with what it does
support, dropping the rest.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/a9f2eebf11c6b0c3a2e3bf42e71392cdfd2835d1.1755872208.git.mchehab+huawei@kernel.org
2025-08-29 15:54:43 -06:00
Mauro Carvalho Chehab
4aa578f9c0 docs: kernel_include.py: remove line numbers from parsed-literal
When parsed-literal directive is added to rawtext, while cross
references will be properly displayed, Sphinx will ignore
line numbers. So, it is not worth adding them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/b484fe5fcbf6e5217f112f205fbf54f0bbc3dcca.1755872208.git.mchehab+huawei@kernel.org
2025-08-29 15:54:43 -06:00
Mauro Carvalho Chehab
01dba1680c docs: kernel_include.py: move apply_range() and add a docstring
While not required, better to have caller functions at the end.
As apply_range() is now called by xref_text(), move it to be
before the latter.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/a6ce0fd7c03a01338753fd81ed0c4631f78311d6.1755872208.git.mchehab+huawei@kernel.org
2025-08-29 15:54:43 -06:00
Mauro Carvalho Chehab
4ad9cabc34 docs: kernel_include.py: append line numbers to better report errors
It is best to point to the original line of code that generated
an error than to point to the beginning of a directive.

Add support for it. It should be noticed that this won't work
for literal or code blocks, as Sphinx will ignore it, pointing
to the beginning of the directive. Yet, when the output is known
to be in ReST format, like on TOC, this makes the error a lot
more easier to be handled.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/a0953af8b71e64aaf2e0ba4593ad39e19587d50a.1755872208.git.mchehab+huawei@kernel.org
2025-08-29 15:54:43 -06:00