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
This commit is contained in:
Mauro Carvalho Chehab
2025-02-10 11:18:05 +01:00
committed by Jonathan Corbet
parent ee34f8300c
commit aea5e52dce
3 changed files with 48 additions and 45 deletions

View File

@@ -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"""