summaryrefslogtreecommitdiff
path: root/tools/docs
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-10-10 01:31:20 +0100
committerMark Brown <broonie@kernel.org>2026-10-10 01:31:20 +0100
commitdba9716e82ae2c9eacfdc0925360375cd0bb6830 (patch)
treeb0a41f80f6a35a4be3c607e3957a9d08718baca8 /tools/docs
parentc148298f22c67c053bf6507ed092e0ae58a4b2a8 (diff)
parentef777ef05ebcc5ea5393b4bd5af6fc3ad1b3aec9 (diff)
downloadlinux-next-dba9716e82ae2c9eacfdc0925360375cd0bb6830.tar.gz
linux-next-dba9716e82ae2c9eacfdc0925360375cd0bb6830.zip
Merge branch 'spec' of https://git.kernel.org/pub/scm/linux/kernel/git/sashal/kapi.git
# Conflicts: # Makefile # fs/open.c
Diffstat (limited to 'tools/docs')
-rwxr-xr-xtools/docs/kernel-doc12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/docs/kernel-doc b/tools/docs/kernel-doc
index d9192c3f1645..4c45c0d6cfa9 100755
--- a/tools/docs/kernel-doc
+++ b/tools/docs/kernel-doc
@@ -250,6 +250,8 @@ def main():
help="Output reStructuredText format (default).")
out_fmt.add_argument("-N", "-none", "--none", action="store_true",
help="Do not output documentation, only warnings.")
+ out_fmt.add_argument("-apispec", "--apispec", action="store_true",
+ help="Output C macro invocations for kernel API specifications.")
out_fmt.add_argument("-y", "--yaml-file", "--yaml",
help="Stores kernel-doc output on a yaml file.")
@@ -326,6 +328,7 @@ def main():
#
from kdoc.kdoc_files import KernelFiles # pylint: disable=C0415
from kdoc.kdoc_output import RestFormat, ManFormat # pylint: disable=C0415
+ from kdoc.kdoc_apispec import ApiSpecFormat # pylint: disable=C0415
yaml_content = set()
if args.yaml_file:
@@ -351,12 +354,16 @@ def main():
out_style = None
n_outputs += 1
+ if args.apispec:
+ out_style = ApiSpecFormat()
+ n_outputs += 1
+
if args.rst or n_outputs == 0:
n_outputs += 1
out_style = RestFormat()
if n_outputs > 1:
- parser.error("Those arguments are muttually exclusive: --man, --rst, --none, except when generating a YAML file.")
+ parser.error("Those arguments are muttually exclusive: --man, --rst, --none, --apispec, except when generating a YAML file.")
elif not n_outputs:
out_style = RestFormat()
@@ -365,7 +372,8 @@ def main():
yaml_file=args.yaml_file, yaml_content=yaml_content,
out_style=out_style, werror=args.werror,
wreturn=args.wreturn, wshort_desc=args.wshort_desc,
- wcontents_before_sections=args.wcontents_before_sections)
+ wcontents_before_sections=args.wcontents_before_sections,
+ apispec=args.apispec)
kfiles.parse(args.files, export_file=args.export_file)