Anastasia Klimchuk submitted this change.

View Change

Approvals: Peter Marheine: Looks good to me, approved build bot (Jenkins): Verified
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>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/83129
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M print.c
1 file changed, 13 insertions(+), 3 deletions(-)

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;
}


To view, visit change 83129. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ie011db3985172d05f5160d1cb1cc39a4422a5750
Gerrit-Change-Number: 83129
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>