diff options
author | Pali Rohár <pali@kernel.org> | 2021-12-31 14:39:51 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2022-02-10 13:49:35 +0100 |
commit | fd9c6a29a32659287cb7be52b2f2ca638cda35ad (patch) | |
tree | 694da6f6a26d2f911d334d93d943690c48271e52 | |
parent | 67954c8b6514859a0e115538200187f3a1ffd366 (diff) | |
download | pciutils-fd9c6a29a32659287cb7be52b2f2ca638cda35ad.tar.gz |
lspci: Do not show -[00]- bus in tree output
Secondary or subordinate bus cannot be zero. Zero value could indicate
either invalid secondary bus value or the fact that secondary bus value was
not filled or indicates non-compliant PCI-to-PCI bridge. This change makes
tree output better readable when bus numbers are not known or not provided.
-rw-r--r-- | ls-tree.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -258,7 +258,9 @@ show_tree_dev(struct device *d, char *line, char *p) for (b=&host_bridge; b; b=b->chain) if (b->br_dev == d) { - if (b->secondary == b->subordinate) + if (b->secondary == 0) + p = tree_printf(line, p, "-"); + else if (b->secondary == b->subordinate) p = tree_printf(line, p, "-[%02x]-", b->secondary); else p = tree_printf(line, p, "-[%02x-%02x]-", b->secondary, b->subordinate); |