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:09 +0300
committerJonathan Corbet <corbet@lwn.net>2025-02-10 21:19:57 +0300
commit5d7871d77f6d62406b3d459a58810c1ddb8904c2 (patch)
treeefe1be986f50d6e37abe53707f88ccdcdcf55331 /scripts/lib/abi/abi_parser.py
parent98a4324a8b7bbe433483c90524026be0ccc9ffa8 (diff)
downloadlinux-5d7871d77f6d62406b3d459a58810c1ddb8904c2.tar.xz
docs: sphinx/kernel_abi: parse ABI files only once
Right now, the logic parses ABI files on 4 steps, one for each directory. While this is fine in principle, by doing that, not all symbol cross-references will be created. Change the logic to do the parsing only once in order to get a global dictionary to be used when creating ABI cross-references. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/5205c53838b6ea25f4cdd4cc1e3d17c0141e75a6.1739182025.git.mchehab+huawei@kernel.org
Diffstat (limited to 'scripts/lib/abi/abi_parser.py')
-rw-r--r--scripts/lib/abi/abi_parser.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/scripts/lib/abi/abi_parser.py b/scripts/lib/abi/abi_parser.py
index 6fac461d794c..87d1b9e14bb3 100644
--- a/scripts/lib/abi/abi_parser.py
+++ b/scripts/lib/abi/abi_parser.py
@@ -266,12 +266,20 @@ class AbiParser:
def parse_readme(self, nametag, fname):
"""Parse ABI README file"""
+ nametag["what"] = ["ABI file contents"]
+ nametag["path"] = "README"
with open(fname, "r", encoding="utf8", errors="backslashreplace") as fp:
- nametag["description"] = "```\n"
for line in fp:
- nametag["description"] += " " + line
+ match = self.re_tag.match(line)
+ if match:
+ new = match.group(1).lower()
+
+ match = self.re_valid.search(new)
+ if match:
+ nametag["description"] += "\n:" + line
+ continue
- nametag["description"] += "```\n"
+ nametag["description"] += line
def parse_file(self, fname, path, basename):
"""Parse a single file"""
@@ -459,12 +467,8 @@ class AbiParser:
continue
if filter_path:
- if filter_path == "README":
- if not names[0].endswith("README"):
- continue
- else:
- if v.get("path") != filter_path:
- continue
+ if v.get("path") != filter_path:
+ continue
msg = ""