From: deraadt Date: Thu, 19 Dec 1996 18:26:58 +0000 (+0000) Subject: netbsd fix to problem found by m4@nts.umn.edu X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=30591f2bca09a9d0557628aa147b6abdca123633;p=openbsd netbsd fix to problem found by m4@nts.umn.edu --- diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c index 57c0f0ba77a..d62139b68ee 100644 --- a/sys/dev/ccd.c +++ b/sys/dev/ccd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ccd.c,v 1.12 1996/05/10 12:32:11 deraadt Exp $ */ +/* $OpenBSD: ccd.c,v 1.13 1996/12/19 18:26:58 deraadt Exp $ */ /* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */ /*- @@ -744,6 +744,7 @@ ccdbuffer(cs, bp, bn, addr, bcount, cbpp) register struct ccdcinfo *ci, *ci2 = NULL; register struct ccdbuf *cbp; register daddr_t cbn, cboff; + int ccdisk; #ifdef DEBUG if (ccddebug & CCDB_IO) @@ -763,7 +764,9 @@ ccdbuffer(cs, bp, bn, addr, bcount, cbpp) register daddr_t sblk; sblk = 0; - for (ci = cs->sc_cinfo; cbn >= sblk + ci->ci_size; ci++) + for (ccdisk = 0, ci = &cs->sc_cinfo[ccdisk]; + cbn >= sblk + ci->ci_size; + ccdisk++, ci = &cs->sc_cinfo[ccdisk]) sblk += ci->ci_size; cbn -= sblk; } @@ -772,7 +775,7 @@ ccdbuffer(cs, bp, bn, addr, bcount, cbpp) */ else { register struct ccdiinfo *ii; - int ccdisk, off; + int off; cboff = cbn % cs->sc_ileave; cbn /= cs->sc_ileave; @@ -826,8 +829,8 @@ ccdbuffer(cs, bp, bn, addr, bcount, cbpp) * context for ccdiodone */ cbp->cb_obp = bp; - cbp->cb_unit = cs - ccd_softc; - cbp->cb_comp = ci - cs->sc_cinfo; + cbp->cb_unit = cs->sc_unit; + cbp->cb_comp = ccdisk; /* First buffer is dealt with. */ cbpp[0] = cbp;