]> mj.ucw.cz Git - pciutils.git/commitdiff
fix minor logic error in grow_tree()
authorJason Lunz <lunz@falooley.org>
Sat, 24 Mar 2007 16:59:40 +0000 (12:59 -0400)
committerMartin Mares <mj@ucw.cz>
Fri, 30 Mar 2007 09:56:36 +0000 (11:56 +0200)
The branches for PCI_HEADER_TYPE_BRIDGE and PCI_HEADER_TYPE_CARDBUS were
switched, but happened to do the same thing because the PCI_ and PCI_CB_
constants are the same.

lspci.c

diff --git a/lspci.c b/lspci.c
index 52c0ba0028451d0e863bc15dfab24f08f65312f8..192ef57ef5b74e6b1619c3ef3975f0d6e42bfd5b 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -2005,17 +2005,17 @@ grow_tree(void)
          b = xmalloc(sizeof(struct bridge));
          b->domain = d->dev->domain;
          if (ht == PCI_HEADER_TYPE_BRIDGE)
-           {
-             b->primary = get_conf_byte(d, PCI_CB_PRIMARY_BUS);
-             b->secondary = get_conf_byte(d, PCI_CB_CARD_BUS);
-             b->subordinate = get_conf_byte(d, PCI_CB_SUBORDINATE_BUS);
-           }
-         else
            {
              b->primary = get_conf_byte(d, PCI_PRIMARY_BUS);
              b->secondary = get_conf_byte(d, PCI_SECONDARY_BUS);
              b->subordinate = get_conf_byte(d, PCI_SUBORDINATE_BUS);
            }
+         else
+           {
+             b->primary = get_conf_byte(d, PCI_CB_PRIMARY_BUS);
+             b->secondary = get_conf_byte(d, PCI_CB_CARD_BUS);
+             b->subordinate = get_conf_byte(d, PCI_CB_SUBORDINATE_BUS);
+           }
          *last_br = b;
          last_br = &b->chain;
          b->next = b->child = NULL;