/*
- * $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
*
#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 {
if (c != buf)
*c++ = ',';
*c++ = 'x';
- *c++ = '0' + (4 >> i);
+ *c++ = '0' + (1 << i);
}
if (c != buf)
*c = 0;
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