From: Jason Lunz Date: Sat, 24 Mar 2007 16:59:40 +0000 (-0400) Subject: fix minor logic error in grow_tree() X-Git-Tag: v3.0.0~8^2~40 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=7c874c1c12e02f0a1eec4fb306e83f693065df58;p=pciutils.git fix minor logic error in grow_tree() 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. --- diff --git a/lspci.c b/lspci.c index 52c0ba0..192ef57 100644 --- 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;