]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
docs: kdoc_output: pick a better default for modulename
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 6 Mar 2026 15:45:47 +0000 (16:45 +0100)
committerJonathan Corbet <corbet@lwn.net>
Mon, 9 Mar 2026 16:34:38 +0000 (10:34 -0600)
Instead of placing the same data for modulename for all generated
man pages, use the directory from the filename used to produce
kernel docs as basis.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <8a5d91c93c0b9b34c2f60e389f4464742804d0d6.1772810752.git.mchehab+huawei@kernel.org>

tools/docs/kernel-doc
tools/lib/python/kdoc/kdoc_output.py

index aed09f9a54dd1377db211d752db340f926f66333..3a932f95bdf568b218a7224ba20ca4a6ba06b856 100755 (executable)
@@ -210,7 +210,6 @@ def main():
                         help="Enable debug messages")
 
     parser.add_argument("-M", "-modulename", "--modulename",
-                        default="Kernel API",
                         help="Allow setting a module name at the output.")
 
     parser.add_argument("-l", "-enable-lineno", "--enable_lineno",
index 7a181b40810d6920e42d35192d395748766812be..c25f80a39cdc9f8dae09e652a1ce3bc8206d5bf5 100644 (file)
@@ -589,7 +589,8 @@ class ManFormat(OutputFormat):
     ``modulename``
         Defines the module name to be used at the troff ``.TH`` output.
 
-        This argument is mandatory.
+        This argument is optional. If not specified, it will be filled
+        with the directory which contains the documented file.
 
     ``section``
         Usually a numeric value from 0 to 9, but man pages also accept
@@ -645,8 +646,8 @@ class ManFormat(OutputFormat):
         title = name.strip()
         module = self.modulename(args)
 
-        self.data += f'.TH "{name}" {self.section} "{self.date}" '
-        self.data += f'"{self.modulename}" "{self.manual}"\n'
+        self.data += f'.TH "{title}" {self.section} "{self.date}" '
+        self.data += f'"{module}" "{self.manual}"\n'
 
     def __init__(self, modulename=None, section="9", manual="Kernel API Manual"):
         """