Index: sys/dev/fdc/fdc.c =================================================================== --- sys/dev/fdc/fdc.c +++ sys/dev/fdc/fdc.c @@ -941,7 +941,7 @@ /* Disable ISADMA if we bailed while it was active */ if (fd != NULL && (fd->flags & FD_ISADMA)) { isa_dmadone( - bp->bio_cmd & BIO_READ ? ISADMA_READ : ISADMA_WRITE, + bp->bio_cmd == BIO_READ ? ISADMA_READ : ISADMA_WRITE, fd->fd_ioptr, fd->fd_iosize, fdc->dmachan); mtx_lock(&fdc->fdc_mtx); fd->flags &= ~FD_ISADMA; @@ -983,7 +983,7 @@ fd = fdc->fd = bp->bio_driver1; fdc->retry = 0; fd->fd_ioptr = bp->bio_data; - if (bp->bio_cmd & BIO_FMT) { + if (bp->bio_cmd == BIO_FMT) { i = offsetof(struct fd_formb, fd_formb_cylno(0)); fd->fd_ioptr += i; fd->fd_iosize = bp->bio_length - i; @@ -1021,7 +1021,7 @@ fdctl_wr(fdc, fd->ft->trans); #endif - if (bp->bio_cmd & BIO_PROBE) { + if (bp->bio_cmd == BIO_PROBE) { if ((!(device_get_flags(fd->dev) & FD_NO_CHLINE) && #ifndef PC98 !(fdin_rd(fdc) & FDI_DCHG) && @@ -1059,7 +1059,7 @@ #endif /* Check if the floppy is write-protected */ - if (bp->bio_cmd & (BIO_FMT | BIO_WRITE)) { + if (bp->bio_cmd == BIO_FMT || bp->bio_cmd == BIO_WRITE) { retry_line = __LINE__; if(fdc_sense_drive(fdc, &st3) != 0) return (1); @@ -1078,10 +1078,11 @@ sec = sec % fd->ft->sectrac + 1; /* If everything is going swimmingly, use multisector xfer */ - if (fdc->retry == 0 && bp->bio_cmd & (BIO_READ|BIO_WRITE)) { + if (fdc->retry == 0 && + (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE)) { fd->fd_iosize = imin(nsect * fd->sectorsize, bp->bio_resid); nsect = fd->fd_iosize / fd->sectorsize; - } else if (bp->bio_cmd & (BIO_READ|BIO_WRITE)) { + } else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { fd->fd_iosize = fd->sectorsize; nsect = 1; } @@ -1141,10 +1142,12 @@ fd->fd_ioptr, fdc->retry); /* Setup ISADMA if we need it and have it */ - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_FMT)) + if ((bp->bio_cmd == BIO_READ || + bp->bio_cmd == BIO_WRITE || + bp->bio_cmd == BIO_FMT)) && !(fdc->flags & FDC_NODMA)) { isa_dmastart( - bp->bio_cmd & BIO_READ ? ISADMA_READ : ISADMA_WRITE, + bp->bio_cmd == BIO_READ ? ISADMA_READ : ISADMA_WRITE, fd->fd_ioptr, fd->fd_iosize, fdc->dmachan); mtx_lock(&fdc->fdc_mtx); fd->flags |= FD_ISADMA; @@ -1153,9 +1156,12 @@ /* Do PIO if we have to */ if (fdc->flags & FDC_NODMA) { - if (bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_FMT)) + if (bp->bio_cmd == BIO_READ || + bp->bio_cmd == BIO_WRITE || + bp->bio_cmd == BIO_FMT) fdbcdr_wr(fdc, 1, fd->fd_iosize); - if (bp->bio_cmd & (BIO_WRITE|BIO_FMT)) + if (bp->bio_cmd == BIO_WRITE || + bp->bio_cmd == BIO_FMT) fdc_pio(fdc); } @@ -1218,13 +1224,13 @@ i = tsleep(fdc, PRIBIO, "fddata", hz); /* PIO if the read looks good */ - if (i == 0 && (fdc->flags & FDC_NODMA) && (bp->bio_cmd & BIO_READ)) + if (i == 0 && (fdc->flags & FDC_NODMA) && (bp->bio_cmd == BIO_READ)) fdc_pio(fdc); /* Finish DMA */ if (fd->flags & FD_ISADMA) { isa_dmadone( - bp->bio_cmd & BIO_READ ? ISADMA_READ : ISADMA_WRITE, + bp->bio_cmd == BIO_READ ? ISADMA_READ : ISADMA_WRITE, fd->fd_ioptr, fd->fd_iosize, fdc->dmachan); mtx_lock(&fdc->fdc_mtx); fd->flags &= ~FD_ISADMA; @@ -1668,7 +1674,7 @@ fd = bp->bio_to->geom->softc; fdc = fd->fdc; bp->bio_driver1 = fd; - if (bp->bio_cmd & BIO_GETATTR) { + if (bp->bio_cmd == BIO_GETATTR) { if (g_handleattr_int(bp, "GEOM::fwsectors", fd->ft->sectrac)) return; if (g_handleattr_int(bp, "GEOM::fwheads", fd->ft->heads)) @@ -1676,7 +1682,7 @@ g_io_deliver(bp, ENOIOCTL); return; } - if (!(bp->bio_cmd & (BIO_READ|BIO_WRITE))) { + if (!(bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE)) { g_io_deliver(bp, EOPNOTSUPP); return; }