From 8d047897623f2e14aaa4ada0400adeb5271460b1 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 3 Nov 1999 09:30:09 +0000 Subject: [PATCH] If prog-if is zero, but it's present in the ID list, show it. --- ChangeLog | 5 +++++ lspci.c | 23 ++++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a7ab48..11aeddd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 3 10:24:38 1999 Martin Mares + + * lspci.c (show_terse): If prog-if is zero, but it's present in the + ID list, show it. + Sat Oct 30 11:06:35 1999 Martin Mares * Released as version 2.1. diff --git a/lspci.c b/lspci.c index 41b88d3..14c943d 100644 --- a/lspci.c +++ b/lspci.c @@ -1,5 +1,5 @@ /* - * $Id: lspci.c,v 1.30 1999/10/09 13:26:02 mj Exp $ + * $Id: lspci.c,v 1.31 1999/11/03 09:30:11 mj Exp $ * * Linux PCI Utilities -- List All PCI Devices * @@ -240,15 +240,20 @@ show_terse(struct device *d) p->vendor_id, p->device_id, 0, 0)); if (c = get_conf_byte(d, PCI_REVISION_ID)) printf(" (rev %02x)", c); - if (verbose && (c = get_conf_byte(d, PCI_CLASS_PROG))) + if (verbose) { - char *x = pci_lookup_name(pacc, devbuf, sizeof(devbuf), - PCI_LOOKUP_PROGIF, - get_conf_word(d, PCI_CLASS_DEVICE), c, 0, 0); - printf(" (prog-if %02x", c); - if (x) - printf(" [%s]", x); - putchar(')'); + char *x; + c = get_conf_byte(d, PCI_CLASS_PROG); + x = pci_lookup_name(pacc, devbuf, sizeof(devbuf), + PCI_LOOKUP_PROGIF, + get_conf_word(d, PCI_CLASS_DEVICE), c, 0, 0); + if (c || x) + { + printf(" (prog-if %02x", c); + if (x) + printf(" [%s]", x); + putchar(')'); + } } putchar('\n'); } -- 2.39.5