summaryrefslogtreecommitdiff
path: root/usr.sbin/pciconf/pciconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pciconf/pciconf.c')
-rw-r--r--usr.sbin/pciconf/pciconf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index 1d7954d3fb331..2f2979a2d9597 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -29,7 +29,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: pciconf.c,v 1.6 1998/09/15 08:21:13 gibbs Exp $";
+ "$Id: pciconf.c,v 1.5 1997/10/06 11:38:30 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -134,7 +134,6 @@ list_devs(void)
int fd;
struct pci_conf_io pc;
struct pci_conf conf[255], *p;
- int none_count = 0;
fd = open(_PATH_DEVPCI, O_RDWR, 0);
if (fd < 0)
@@ -168,13 +167,12 @@ list_devs(void)
return;
}
for (p = conf; p < &conf[pc.num_matches]; p++) {
+ if ((p->pd_name == NULL) || (*p->pd_name == '\0'))
+ continue;
printf("%s%d@pci%d:%d:%d:\tclass=0x%06x card=0x%08lx "
"chip=0x%08lx rev=0x%02x hdr=0x%02x\n",
- (p->pd_name && *p->pd_name) ? p->pd_name :
- "none",
- (p->pd_name && *p->pd_name) ? p->pd_unit :
- none_count++,
+ p->pd_name, p->pd_unit,
p->pc_sel.pc_bus, p->pc_sel.pc_dev,
p->pc_sel.pc_func, (p->pc_class << 16) |
(p->pc_subclass << 8) | p->pc_progif,