Eliminate unnecessary goto and labels, and other minor cleanup.

This commit is contained in:
scottr 1996-01-23 00:28:09 +00:00
parent 93542f4a98
commit f9418ec605
1 changed files with 14 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ct.c,v 1.13 1995/12/02 18:21:52 thorpej Exp $ */ /* $NetBSD: ct.c,v 1.14 1996/01/23 00:28:09 scottr Exp $ */
/* /*
* Copyright (c) 1982, 1990, 1993 * Copyright (c) 1982, 1990, 1993
@ -380,22 +380,22 @@ ctcommand(dev, cmd, cnt)
bp->b_un.b_addr = nbp->b_un.b_addr; bp->b_un.b_addr = nbp->b_un.b_addr;
bp->b_bcount = MAXBSIZE; bp->b_bcount = MAXBSIZE;
} }
again:
bp->b_flags = B_BUSY; while (cnt-- > 0) {
if (cmd == MTBSF) { bp->b_flags = B_BUSY;
sc->sc_blkno = sc->sc_eofs[sc->sc_eofp]; if (cmd == MTBSF) {
sc->sc_eofp--; sc->sc_blkno = sc->sc_eofs[sc->sc_eofp];
sc->sc_eofp--;
#ifdef DEBUG #ifdef DEBUG
if (ctdebug & CT_BSF) if (ctdebug & CT_BSF)
printf("%s: backup eof pos %d blk %d\n", printf("%s: backup eof pos %d blk %d\n",
sc->sc_hd->hp_xname, sc->sc_eofp, sc->sc_hd->hp_xname, sc->sc_eofp,
sc->sc_eofs[sc->sc_eofp]); sc->sc_eofs[sc->sc_eofp]);
#endif #endif
}
ctstrategy(bp);
iowait(bp);
} }
ctstrategy(bp);
iowait(bp);
if (--cnt > 0)
goto again;
bp->b_flags = 0; bp->b_flags = 0;
sc->sc_flags &= ~CTF_CMD; sc->sc_flags &= ~CTF_CMD;
if (nbp) if (nbp)
@ -444,7 +444,6 @@ ctstart(unit)
register int i; register int i;
bp = cttab[unit].b_actf; bp = cttab[unit].b_actf;
again:
if ((sc->sc_flags & CTF_CMD) && sc->sc_bp == bp) { if ((sc->sc_flags & CTF_CMD) && sc->sc_bp == bp) {
switch(sc->sc_cmd) { switch(sc->sc_cmd) {
@ -804,7 +803,6 @@ ctread(dev, uio, flags)
struct uio *uio; struct uio *uio;
int flags; int flags;
{ {
return (physio(ctstrategy, NULL, dev, B_READ, minphys, uio)); return (physio(ctstrategy, NULL, dev, B_READ, minphys, uio));
} }
@ -814,7 +812,6 @@ ctwrite(dev, uio, flags)
struct uio *uio; struct uio *uio;
int flags; int flags;
{ {
/* XXX: check for hardware write-protect? */ /* XXX: check for hardware write-protect? */
return (physio(ctstrategy, NULL, dev, B_WRITE, minphys, uio)); return (physio(ctstrategy, NULL, dev, B_WRITE, minphys, uio));
} }