summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-02-20 03:39:08 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-02-20 03:39:08 +0000
commit165ffbca50a625195003fc336aa16f7218862bdf (patch)
tree283ccb30220d38cb04177548035ead1f061d38e7 /sys/dev
parent99c6d4b1e653de29b5d339569f60b2e7a53a1bb4 (diff)
jsg@ pointed out i am bad at loops.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/qla.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/ic/qla.c b/sys/dev/ic/qla.c
index bbbbea05b14..9a42cffc2bc 100644
--- a/sys/dev/ic/qla.c
+++ b/sys/dev/ic/qla.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qla.c,v 1.25 2014/02/20 00:42:44 dlg Exp $ */
+/* $OpenBSD: qla.c,v 1.26 2014/02/20 03:39:07 dlg Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -1208,17 +1208,15 @@ qla_read_queue_2100(struct qla_softc *sc, bus_size_t queue)
{
u_int16_t a, b, i;
- do {
+ for (i = 0; i < 1000; i++) {
a = qla_read(sc, queue);
b = qla_read(sc, queue);
if (a == b)
return (a);
+ }
- } while (++i < 1000);
-
- DPRINTF(QLA_D_INTR, "%s: queue ptr unstable\n",
- DEVNAME(sc));
+ DPRINTF(QLA_D_INTR, "%s: queue ptr unstable\n", DEVNAME(sc));
return (a);
}