[PATCH] docs: kdoc_output: only use out_tail when the identfier is shown

Randy Dunlap <[email protected]>
Newsgroups gmane.linux.documentation,gmane.linux.kernel
Message-ID <[email protected]>
In -man mode, scripts/kernel-doc prints the "out_tail" information for
all symbols that are found (without the symbol info), whether the
symbols match the output selection criteria or not.

This can cause quite a lot of extraneous output in -man mode for the
symbols that are not in the selection criteria.

Modify kdoc_output.py so that it only calls out_tail() for symbols that
are being shown according to the selection criteria.

Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Randy Dunlap <[email protected]>
---
Cc: Jonathan Corbet <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: [email protected]

 tools/lib/python/kdoc/kdoc_output.py |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- linux-next-20260814.orig/tools/lib/python/kdoc/kdoc_output.py
+++ linux-next-20260814/tools/lib/python/kdoc/kdoc_output.py
@@ -198,22 +198,27 @@ class OutputFormat:
 
         if dtype == "function":
             self.out_function(fname, name, args)
+            self.out_tail(fname, name, args)
             return self.data
 
         if dtype == "enum":
             self.out_enum(fname, name, args)
+            self.out_tail(fname, name, args)
             return self.data
 
         if dtype == "var":
             self.out_var(fname, name, args)
+            self.out_tail(fname, name, args)
             return self.data
 
         if dtype == "typedef":
             self.out_typedef(fname, name, args)
+            self.out_tail(fname, name, args)
             return self.data
 
         if dtype in ["struct", "union"]:
             self.out_struct(fname, name, args)
+            self.out_tail(fname, name, args)
             return self.data
 
         # Warn if some type requires an output logic
@@ -763,7 +768,6 @@ class ManFormat(OutputFormat):
         Add a tail at the end of man pages output.
         """
         super().msg(fname, name, args)
-        self.out_tail(fname, name, args)
 
         return self.data
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.