diff mbox series

[pciutils] dump: Allow more leading zeros in dump line number

Message ID 20211220155659.1343-1-pali@kernel.org
State New
Headers show
Series [pciutils] dump: Allow more leading zeros in dump line number | expand

Commit Message

Pali Rohár Dec. 20, 2021, 3:56 p.m. UTC
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(-)

Comments

Martin Mareš Dec. 26, 2021, 9:58 p.m. UTC | #1
Hi!

> 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
diff mbox series

Patch

diff --git a/lib/dump.c b/lib/dump.c
index 879c62449b27..c0f929133973 100644
--- a/lib/dump.c
+++ b/lib/dump.c
@@ -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;