From 3338c9e2e785ecbbbb4c24aaf79ebdf77f0d26ec Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Thu, 6 Apr 2006 04:16:36 +0000 Subject: kudos to djm for finding an embarrassing bug. using the same variable as a counter for both an inner and outer loop is not good(tm). ok marco@ --- sys/dev/ic/ami.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 1abbfb13cad..d008c5e799e 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.141 2006/04/05 14:07:24 dlg Exp $ */ +/* $OpenBSD: ami.c,v 1.142 2006/04/06 04:16:35 dlg Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -1040,7 +1040,7 @@ void ami_complete(struct ami_softc *sc, struct ami_ccb *ccb, int timeout) { struct ami_iocmd mbox; - int i = 0, done = 0; + int i = 0, j, done = 0; int s; s = splbio(); @@ -1065,8 +1065,8 @@ ami_complete(struct ami_softc *sc, struct ami_ccb *ccb, int timeout) i = 0; while (i < timeout) { if (sc->sc_done(sc, &mbox) != 0) { - for (i = 0; i < mbox.acc_nstat; i++) { - int ready = mbox.acc_cmplidl[i]; + for (j = 0; j < mbox.acc_nstat; j++) { + int ready = mbox.acc_cmplidl[j]; ami_done(sc, ready); if (ready == ccb->ccb_cmd.acc_id) done = 1; -- cgit v1.2.3