avoid very long loop when you run pcictl on a PCI bus which has no devices on it.
This commit is contained in:
parent
9f892c7bca
commit
2abd1dd123
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: pcictl.c,v 1.8 2004/04/24 13:41:51 kleink Exp $ */
|
/* $NetBSD: pcictl.c,v 1.9 2006/08/24 07:30:16 bsh Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2001 Wasabi Systems, Inc.
|
* Copyright 2001 Wasabi Systems, Inc.
|
||||||
|
@ -264,6 +264,9 @@ scan_pci(int busarg, int devarg, int funcarg, void (*cb)(u_int, u_int, u_int))
|
||||||
|
|
||||||
if (devarg == -1) {
|
if (devarg == -1) {
|
||||||
devmin = 0;
|
devmin = 0;
|
||||||
|
if (pci_businfo.maxdevs <= 0)
|
||||||
|
devmax = 0;
|
||||||
|
else
|
||||||
devmax = pci_businfo.maxdevs - 1;
|
devmax = pci_businfo.maxdevs - 1;
|
||||||
} else
|
} else
|
||||||
devmin = devmax = devarg;
|
devmin = devmax = devarg;
|
||||||
|
|
Loading…
Reference in New Issue