summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/kdoc_output.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2026-03-18 10:11:05 +0100
committerJonathan Corbet <corbet@lwn.net>2026-03-22 15:10:40 -0600
commit9ab2ca3dd127194a55bd9789c031e800fd19c254 (patch)
tree39b96b179068645f4eb72f1d7ca5c119a743a94d /tools/lib/python/kdoc/kdoc_output.py
parente0ebee442d56c11df023b7c2d32edc3b0765b2f3 (diff)
downloadlwn-9ab2ca3dd127194a55bd9789c031e800fd19c254.tar.gz
lwn-9ab2ca3dd127194a55bd9789c031e800fd19c254.zip
docs: kdoc_files: move output symbols logic to kdoc_output
When writing unittests for kdoc_output, it became clear that the logic with handles a series of KdocItem symbols from a single file belons to kdoc_output, and not to kdoc_files. Move the code to it. While here, also ensure that self.config will be placed together with set.out_style. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <4ebc26e37a0b544c50d50b8077760f147fa6a535.1773823995.git.mchehab+huawei@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_output.py')
-rw-r--r--tools/lib/python/kdoc/kdoc_output.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/lib/python/kdoc/kdoc_output.py b/tools/lib/python/kdoc/kdoc_output.py
index 08539dd92cbb..73d71cbeabb5 100644
--- a/tools/lib/python/kdoc/kdoc_output.py
+++ b/tools/lib/python/kdoc/kdoc_output.py
@@ -222,6 +222,27 @@ class OutputFormat:
return None
+ def output_symbols(self, fname, symbols):
+ """
+ Handles a set of KdocItem symbols.
+ """
+ self.set_symbols(symbols)
+
+ msg = ""
+ for arg in symbols:
+ m = self.msg(fname, arg.name, arg)
+
+ if m is None:
+ ln = arg.get("ln", 0)
+ dtype = arg.get('type', "")
+
+ self.config.log.warning("%s:%d Can't handle %s",
+ fname, ln, dtype)
+ else:
+ msg += m
+
+ return msg
+
# Virtual methods to be overridden by inherited classes
# At the base class, those do nothing.
def set_symbols(self, symbols):