Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/83129?usp=email )
Change subject: print.c: Print total numbers of supported USB and PCI devices ......................................................................
print.c: Print total numbers of supported USB and PCI devices
This adds two lines at the very end of the section with supported deviced per programmer. At the moment of this patch, numbers are:
Supported USB devices, total 30 Supported PCI devices, total 94
All other sections print total numbers, this was only one missing.
Change-Id: Ie011db3985172d05f5160d1cb1cc39a4422a5750 Signed-off-by: Anastasia Klimchuk aklm@flashrom.org --- M print.c 1 file changed, 13 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/29/83129/1
diff --git a/print.c b/print.c index 0caa0da..015f4a8 100644 --- a/print.c +++ b/print.c @@ -444,7 +444,8 @@ } #endif
-static void print_supported_devs(const struct programmer_entry *const prog, const char *const type) +static void print_supported_devs(const struct programmer_entry *const prog, const char *const type, + int* num_devs) { const struct dev_entry *const devs = prog->devs.dev; msg_ginfo("\nSupported %s devices for the %s programmer:\n", type, prog->name); @@ -480,12 +481,17 @@
msg_pinfo(" %04x:%04x %s\n", devs[i].vendor_id, devs[i].device_id, test_state_to_text(devs[i].status)); + if (devs[i].status == OK || devs[i].status == NT || devs[i].status == DEP) + *num_devs += 1; } }
int print_supported(void) { unsigned int i; + int num_pci_devs = 0; + int num_usb_devs = 0; + if (print_supported_chips()) return 1;
@@ -504,10 +510,10 @@ const struct programmer_entry *const prog = programmer_table[i]; switch (prog->type) { case USB: - print_supported_devs(prog, "USB"); + print_supported_devs(prog, "USB", &num_usb_devs); break; case PCI: - print_supported_devs(prog, "PCI"); + print_supported_devs(prog, "PCI", &num_pci_devs); break; case OTHER: if (prog->devs.note != NULL) { @@ -521,6 +527,10 @@ break; } } + + msg_ginfo("\nSupported USB devices, total %d\nSupported PCI devices, total %d\n", + num_usb_devs, num_pci_devs); + return 0; }