diff options
| author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2026-03-23 12:10:50 +0300 |
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2026-03-25 22:36:46 +0300 |
| commit | 99ec67a9984fdf38c7ed78695aeb1b99cfee5b50 (patch) | |
| tree | b00e5dc56d43ec03b1e63441e4e14badc6ec9f73 /tools/lib/python/kdoc/kdoc_files.py | |
| parent | 8326e4a21838593fe67b5d79ba6d0dc8e962ebb9 (diff) | |
| download | linux-99ec67a9984fdf38c7ed78695aeb1b99cfee5b50.tar.xz | |
docs: kdoc: better handle source when producing YAML output
The current logic was storing symbols source code on a list,
not linked to the actual KdocItem. While this works fine when
kernel-doc markups are OK, on places where there is a "/**"
without a valid kernel-doc markup, it ends that the 1:1 match
between source code and KdocItem doesn't happen, causing
problems to generate the YAML output.
Fix it by storing the source code directly into the KdocItem
structure.
This shouldn't affect performance or memory footprint, except
when --yaml option is used.
While here, add a __repr__() function for KdocItem, as it
helps debugging it.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <77902dafabb5c3250486aa2dc1568d5fafa95c5b.1774256269.git.mchehab+huawei@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_files.py')
| -rw-r--r-- | tools/lib/python/kdoc/kdoc_files.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/tools/lib/python/kdoc/kdoc_files.py b/tools/lib/python/kdoc/kdoc_files.py index 5a299ed44d62..2428cfc4e843 100644 --- a/tools/lib/python/kdoc/kdoc_files.py +++ b/tools/lib/python/kdoc/kdoc_files.py @@ -203,10 +203,6 @@ class KernelFiles(): self.results[fname] = entries - source = doc.get_source() - if source: - self.source[fname] = source - def process_export_file(self, fname): """ Parses ``EXPORT_SYMBOL*`` macros from a single Kernel source file. @@ -294,7 +290,6 @@ class KernelFiles(): self.errors = 0 self.results = {} - self.source = {} self.files = set() self.export_files = set() @@ -364,8 +359,7 @@ class KernelFiles(): function_table, enable_lineno, no_doc_sections) - self.test_file.output_symbols(fname, symbols, - self.source.get(fname)) + self.test_file.output_symbols(fname, symbols) continue |
