summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2023-04-18 01:53:55 +0200
committerPali Rohár <pali@kernel.org>2023-04-29 14:22:39 +0200
commit5b0411aa38c04782fd99469263ae3f04eb79ca34 (patch)
tree026d282177b9475cbbc98d5307eeebd087cf14e6
parentc3c2e3cb3e5aa9882c5a7a76a482565990532e81 (diff)
downloadpciutils-5b0411aa38c04782fd99469263ae3f04eb79ca34.tar.gz
ls-tree: Rename struct bridge member next to prev
It refers to the previous value in linked-list, not to the next.
-rw-r--r--ls-tree.c8
-rw-r--r--lspci.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/ls-tree.c b/ls-tree.c
index 8e01dea..6fa6d51 100644
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -76,7 +76,7 @@ insert_dev(struct device *d, struct bridge *b)
if (!bus && ! (bus = find_bus(b, p->domain, p->bus)))
{
struct bridge *c;
- for (c=b->child; c; c=c->next)
+ for (c=b->child; c; c=c->prev)
if (c->domain == (unsigned)p->domain && c->secondary <= p->bus && p->bus <= c->subordinate)
{
insert_dev(d, c);
@@ -126,7 +126,7 @@ grow_tree(void)
}
*last_br = b;
last_br = &b->chain;
- b->next = b->child = NULL;
+ b->prev = b->child = NULL;
b->first_bus = NULL;
b->last_bus = NULL;
b->br_dev = d;
@@ -154,7 +154,7 @@ grow_tree(void)
b->subordinate = b->secondary;
*last_br = b;
last_br = &b->chain;
- b->next = b->child = NULL;
+ b->prev = b->child = NULL;
b->first_bus = NULL;
b->last_bus = NULL;
b->br_dev = parent;
@@ -184,7 +184,7 @@ grow_tree(void)
best = c;
if (best)
{
- b->next = best->child;
+ b->prev = best->child;
best->child = b;
}
}
diff --git a/lspci.h b/lspci.h
index 62d8e92..d6a27a2 100644
--- a/lspci.h
+++ b/lspci.h
@@ -88,7 +88,7 @@ void show_kernel_cleanup(void);
struct bridge {
struct bridge *chain; /* Single-linked list of bridges */
- struct bridge *next, *child; /* Tree of bridges */
+ struct bridge *prev, *child; /* Tree of bridges */
struct bus *first_bus, *last_bus; /* List of buses connected to this bridge */
unsigned int domain;
unsigned int primary, secondary, subordinate; /* Bus numbers */