summaryrefslogtreecommitdiff
path: root/sys/dev/pci/piixpm.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-07-07 03:23:43 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-07-07 03:23:43 +0000
commita5f0745a80317b0785de2a01a7c97d34736c3b97 (patch)
tree417a8ce4c7bc8dd96b0db2a5d9910a400065322a /sys/dev/pci/piixpm.c
parenta2fe356796115a700ec497a65bfdef58b23ff466 (diff)
use nested if-else to eliminate the need for a second polling printf,
suggested by grange@
Diffstat (limited to 'sys/dev/pci/piixpm.c')
-rw-r--r--sys/dev/pci/piixpm.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sys/dev/pci/piixpm.c b/sys/dev/pci/piixpm.c
index 43ef5062cc3..45d78b08b3e 100644
--- a/sys/dev/pci/piixpm.c
+++ b/sys/dev/pci/piixpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: piixpm.c,v 1.22 2006/06/26 15:52:59 brad Exp $ */
+/* $OpenBSD: piixpm.c,v 1.23 2006/07/07 03:23:42 brad Exp $ */
/*
* Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -137,21 +137,23 @@ piixpm_attach(struct device *parent, struct device *self, void *aux)
if ((conf & PIIX_SMB_HOSTC_INTMASK) == PIIX_SMB_HOSTC_SMI) {
/* No PCI IRQ */
printf(": SMI");
- } else if ((conf & PIIX_SMB_HOSTC_INTMASK) == PIIX_SMB_HOSTC_IRQ) {
- /* Install interrupt handler */
- if (pci_intr_map(pa, &ih) == 0) {
- intrstr = pci_intr_string(pa->pa_pc, ih);
- sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO,
- piixpm_intr, sc, sc->sc_dev.dv_xname);
- if (sc->sc_ih != NULL) {
- printf(": %s", intrstr);
- sc->sc_poll = 0;
+ } else {
+ if ((conf & PIIX_SMB_HOSTC_INTMASK) == PIIX_SMB_HOSTC_IRQ) {
+ /* Install interrupt handler */
+ if (pci_intr_map(pa, &ih) == 0) {
+ intrstr = pci_intr_string(pa->pa_pc, ih);
+ sc->sc_ih = pci_intr_establish(pa->pa_pc,
+ ih, IPL_BIO, piixpm_intr, sc,
+ sc->sc_dev.dv_xname);
+ if (sc->sc_ih != NULL) {
+ printf(": %s", intrstr);
+ sc->sc_poll = 0;
+ }
}
}
if (sc->sc_poll)
printf(": polling");
- } else
- printf(": polling");
+ }
printf("\n");