]> mj.ucw.cz Git - pciutils.git/commitdiff
If prog-if is zero, but it's present in the ID list, show it.
authorMartin Mares <mj@ucw.cz>
Wed, 3 Nov 1999 09:30:09 +0000 (09:30 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:10:16 +0000 (14:10 +0200)
ChangeLog
lspci.c

index 3a7ab4858323f63c8e840505759273e250b59575..11aeddd68a0cc1666c2b5a324fef65aebfee2be0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Nov  3 10:24:38 1999  Martin Mares  <mj@albireo.ucw.cz>
+
+       * 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  <mj@albireo.ucw.cz>
 
        * Released as version 2.1.
diff --git a/lspci.c b/lspci.c
index 41b88d32e89f8505c004f700a1c864e41bcae4de..14c943d2670384b4baf0dff3e0b9af5c1b909eca 100644 (file)
--- 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');
 }