summaryrefslogtreecommitdiff
path: root/scripts/lib/kdoc/kdoc_item.py
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2025-07-02 01:47:59 +0300
committerJonathan Corbet <corbet@lwn.net>2025-07-15 22:43:13 +0300
commit8d7338752d76c3854a5c54cf7df976c539baab5b (patch)
tree29bbb3f3855df23105bb70dee66801a7a359c609 /scripts/lib/kdoc/kdoc_item.py
parent8d9d122915492ea6984f32e5df30cef5c582f062 (diff)
downloadlinux-8d7338752d76c3854a5c54cf7df976c539baab5b.tar.xz
docs: kdoc: Centralize handling of the item section list
The section list always comes directly from the under-construction entry and is used uniformly. Formalize section handling in the KdocItem class, and have output_declaration() load the sections directly from the entry, eliminating a lot of duplicated, verbose parameters. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_item.py')
-rw-r--r--scripts/lib/kdoc/kdoc_item.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/lib/kdoc/kdoc_item.py b/scripts/lib/kdoc/kdoc_item.py
index add2cc772fec..f0b2b9082c56 100644
--- a/scripts/lib/kdoc/kdoc_item.py
+++ b/scripts/lib/kdoc/kdoc_item.py
@@ -9,6 +9,8 @@ class KdocItem:
self.name = name
self.type = type
self.declaration_start_line = start_line
+ self.sections = {}
+ self.sections_start_lines = {}
#
# Just save everything else into our own dict so that the output
# side can grab it directly as before. As we move things into more
@@ -24,3 +26,10 @@ class KdocItem:
def __getitem__(self, key):
return self.get(key)
+
+ #
+ # Tracking of section information.
+ #
+ def set_sections(self, sections, start_lines):
+ self.sections = sections
+ self.section_start_lines = start_lines