summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-25 12:18:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-25 12:18:35 +0000
commit4abf735ccbe62153a9fcd248886f0ac74f488980 (patch)
treea3fc10efd252f5234aa0ab7692f7acfd600bf376 /sys/dev
parentdf4c9da5ca528d76760f7fc3c6212f62c75bebb1 (diff)
remove an ugly nested block
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pccbb.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c
index d7f73de280f..2fa6c6f06bc 100644
--- a/sys/dev/pci/pccbb.c
+++ b/sys/dev/pci/pccbb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbb.c,v 1.48 2007/11/23 19:46:16 kettenis Exp $ */
+/* $OpenBSD: pccbb.c,v 1.49 2007/11/25 12:18:34 deraadt Exp $ */
/* $NetBSD: pccbb.c,v 1.96 2004/03/28 09:49:31 nakayama Exp $ */
/*
@@ -554,6 +554,7 @@ pccbb_pci_callback(self)
struct pcmciabus_attach_args paa;
struct cardslot_attach_args caa;
struct cardslot_softc *csc;
+ u_int32_t sockstat;
if (!(sc->sc_flags & CBB_MEMHMAPPED)) {
/* The socket registers aren't mapped correctly. */
@@ -583,13 +584,9 @@ pccbb_pci_callback(self)
powerhook_establish(pccbb_powerhook, sc);
- {
- u_int32_t sockstat =
- bus_space_read_4(base_memt, base_memh, CB_SOCKET_STAT);
- if (0 == (sockstat & CB_SOCKET_STAT_CD)) {
- sc->sc_flags |= CBB_CARDEXIST;
- }
- }
+ sockstat = bus_space_read_4(base_memt, base_memh, CB_SOCKET_STAT);
+ if ((sockstat & CB_SOCKET_STAT_CD) == 0)
+ sc->sc_flags |= CBB_CARDEXIST;
/*
* attach cardbus