Skip to contentSkip to conversation

dump: Allow more leading zeros in dump line number

PATCH Applied Pali Rohár 2 participants 2 messages Dec 20, 2021 – Dec 26, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dump: Allow more leading zeros in dump line number

U-Boot's "pci display.b" command prints pci config space dump with 8 digits in line number. So allow up to the 8 digits in line number to easily parse U-Boot's pci config space dumps.

---
 lib/dump.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/dump.c +3 -1
index 879c62449b27..c0f929133973 100644
@@ -90,7 +90,9 @@ dump_init(struct pci_access *a)
       else if (!len)
 	dev = NULL;
       else if (dev &&
-	       (dump_validate(buf, "##: ") || dump_validate(buf, "###: ")) &&
+	       (dump_validate(buf, "##: ") || dump_validate(buf, "###: ") || dump_validate(buf, "####: ") ||
+		dump_validate(buf, "#####: ") || dump_validate(buf, "######: ") ||
+		dump_validate(buf, "#######: ") || dump_validate(buf, "########: ")) &&
 	       sscanf(buf, "%x: ", &i) == 1)
 	{
 	  struct dump_data *dd = dev->aux;
Signature · 1 line
2.20.1
#1 lore raw

Hi!

Quoted 3 lines

U-Boot's "pci display.b" command prints pci config space dump with 8 digits in line number. So allow up to the 8 digits in line number to easily parse U-Boot's pci config space dumps.

Thanks, applied.

Martin