mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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
This commit is contained in:
committed by
Jonathan Corbet
parent
98a4324a8b
commit
5d7871d77f
@@ -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()
|
||||
|
||||
nametag["description"] += "```\n"
|
||||
match = self.re_valid.search(new)
|
||||
if match:
|
||||
nametag["description"] += "\n:" + line
|
||||
continue
|
||||
|
||||
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 = ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user