[PATCH 09/11] docs: kdoc_output: use a more standard order for .TH on man pages
From: Mauro Carvalho Chehab
Date: Thu Mar 05 2026 - 10:32:00 EST
The generated man pages are not following the current standards
for Linux documentation. Reorder .TH fields for them to look
like other Linux man pages.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
---
tools/docs/sphinx-build-wrapper | 2 +-
tools/lib/python/kdoc/kdoc_output.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrapper
index 4572328e379d..3b3b8dd074a8 100755
--- a/tools/docs/sphinx-build-wrapper
+++ b/tools/docs/sphinx-build-wrapper
@@ -626,7 +626,7 @@ class SphinxBuilder:
# Use shlex here, as it handles well parameters with commas
args = shlex.split(line)
name = args[1].replace("/", " ")
- fname = f"{output_dir}/{args[3]}.{args[2]}"
+ fname = f"{output_dir}/{args[1]}.{args[2]}"
if self.verbose:
print(f"Creating {fname}")
diff --git a/tools/lib/python/kdoc/kdoc_output.py b/tools/lib/python/kdoc/kdoc_output.py
index 62e300e65405..968e1d43de47 100644
--- a/tools/lib/python/kdoc/kdoc_output.py
+++ b/tools/lib/python/kdoc/kdoc_output.py
@@ -611,8 +611,8 @@ class ManFormat(OutputFormat):
"""Emit a title header line."""
name = name.strip()
- self.data += f'.TH "{self.modulename}" {self.section} "{name}" '
- self.data += f'"{self.date}" "{self.manual}"\n'
+ self.data += f'.TH "{name}" {self.section} "{self.date}" '
+ self.data += f'"{self.modulename}" "{self.manual}"\n'
def __init__(self, modulename, section="9", manual="Kernel API Manual"):
"""
--
2.52.0