]> mj.ucw.cz Git - pciutils.git/blobdiff - lspci.c
Some new ID's and German description in the spec file.
[pciutils.git] / lspci.c
diff --git a/lspci.c b/lspci.c
index 77e0786891143a4eeea2b173193c60146bcccc06..b2ce10476ecdf108b4b9090eb9da395ea33213b9 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -1,5 +1,5 @@
 /*
 /*
- *     $Id: lspci.c,v 1.34 2000/01/20 21:23:14 mj Exp $
+ *     $Id: lspci.c,v 1.36 2000/04/21 11:58:00 mj Exp $
  *
  *     Linux PCI Utilities -- List All PCI Devices
  *
  *
  *     Linux PCI Utilities -- List All PCI Devices
  *
@@ -74,6 +74,16 @@ static struct pci_access *pacc;
 #define IO_FORMAT "%04lx"
 #endif
 
 #define IO_FORMAT "%04lx"
 #endif
 
+/*
+ *  If we aren't being compiled by GCC, use malloc() instead of alloca().
+ *  This increases our memory footprint, but only slightly since we don't
+ *  use alloca() much.
+ */
+
+#ifndef __GNUC__
+#define alloca malloc
+#endif
+
 /* Our view of the PCI bus */
 
 struct device {
 /* Our view of the PCI bus */
 
 struct device {
@@ -399,7 +409,7 @@ format_agp_rate(int rate, char *buf)
        if (c != buf)
          *c++ = ',';
        *c++ = 'x';
        if (c != buf)
          *c++ = ',';
        *c++ = 'x';
-       *c++ = '0' + (4 >> i);
+       *c++ = '0' + (1 << i);
       }
   if (c != buf)
     *c = 0;
       }
   if (c != buf)
     *c = 0;
@@ -1006,7 +1016,10 @@ insert_dev(struct device *d, struct bridge *b)
       struct bridge *c;
       for(c=b->child; c; c=c->next)
        if (c->secondary <= p->bus && p->bus <= c->subordinate)
       struct bridge *c;
       for(c=b->child; c; c=c->next)
        if (c->secondary <= p->bus && p->bus <= c->subordinate)
-         return insert_dev(d, c);
+          {
+            insert_dev(d, c);
+            return;
+          }
       bus = new_bus(b, p->bus);
     }
   /* Simple insertion at the end _does_ guarantee the correct order as the
       bus = new_bus(b, p->bus);
     }
   /* Simple insertion at the end _does_ guarantee the correct order as the