From 7c874c1c12e02f0a1eec4fb306e83f693065df58 Mon Sep 17 00:00:00 2001 From: Jason Lunz Date: Sat, 24 Mar 2007 12:59:40 -0400 Subject: [PATCH] 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. --- lspci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; -- 2.39.5