]> mj.ucw.cz Git - pciutils.git/commitdiff
ls-tree: Rename struct bridge member next to prev
authorPali Rohár <pali@kernel.org>
Mon, 17 Apr 2023 23:53:55 +0000 (01:53 +0200)
committerPali Rohár <pali@kernel.org>
Sat, 29 Apr 2023 12:22:39 +0000 (14:22 +0200)
It refers to the previous value in linked-list, not to the next.

ls-tree.c
lspci.h

index 8e01dea18f7882bdfa0a243fe39b341dee18dba2..6fa6d5159d62c4aee18a7d685f748bc015c3b2a5 100644 (file)
--- 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 62d8e927adb1ac06fa804ba7bfed5b4a92abff6b..d6a27a2aee319018a49c01a9c0b0cbb79caa0ad1 100644 (file)
--- 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 */