summaryrefslogtreecommitdiff
path: root/scripts/lib/abi/abi_parser.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-02-10 13:18:05 +0300
committerJonathan Corbet <corbet@lwn.net>2025-02-10 21:19:57 +0300
commitaea5e52dce74f679b91c66caad91d587d5504f6c (patch)
tree26ab5725dedcb13394f365cce097aab754e0e84e /scripts/lib/abi/abi_parser.py
parentee34f8300c8940758dc69f80107d9f5873c08f17 (diff)
downloadlinux-aea5e52dce74f679b91c66caad91d587d5504f6c.tar.xz
docs: sphinx/kernel_abi: reduce buffer usage for ABI messages
Instead of producing a big message with all ABI contents and then parse as a whole, simplify the code by handling each ABI symbol in separate. As an additional benefit, there's no need to place file/line nubers inlined at the data and use a regex to convert them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/15be22955e3c6df49d7256c8fd24f62b397ad0ff.1739182025.git.mchehab+huawei@kernel.org
Diffstat (limited to 'scripts/lib/abi/abi_parser.py')
-rw-r--r--scripts/lib/abi/abi_parser.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/lib/abi/abi_parser.py b/scripts/lib/abi/abi_parser.py
index 57c125fd40a5..1db6c54fc65a 100644
--- a/scripts/lib/abi/abi_parser.py
+++ b/scripts/lib/abi/abi_parser.py
@@ -427,7 +427,7 @@ class AbiParser:
return new_desc + "\n\n"
- def doc(self, enable_lineno, output_in_txt=False, show_file=False):
+ def doc(self, output_in_txt=False, show_file=True):
"""Print ABI at stdout"""
part = None
@@ -444,10 +444,6 @@ class AbiParser:
msg = ""
- if enable_lineno:
- ln = v.get("line_no", 1)
- msg += f".. LINENO {file_ref[0][0]}#{ln}\n\n"
-
if wtype != "File":
cur_part = names[0]
if cur_part.find("/") >= 0:
@@ -508,7 +504,9 @@ class AbiParser:
if users and users.strip(" \t\n"):
msg += f"Users:\n\t{users.strip("\n").replace('\n', '\n\t')}\n\n"
- yield msg
+ ln = v.get("line_no", 1)
+
+ yield (msg, file_ref[0][0], ln)
def check_issues(self):
"""Warn about duplicated ABI entries"""