diff options
| author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2025-02-10 11:18:05 +0100 | 
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2025-02-10 11:19:57 -0700 | 
| commit | aea5e52dce74f679b91c66caad91d587d5504f6c (patch) | |
| tree | 26ab5725dedcb13394f365cce097aab754e0e84e /scripts/lib/abi/abi_parser.py | |
| parent | ee34f8300c8940758dc69f80107d9f5873c08f17 (diff) | |
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.py | 10 | 
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"""  | 
