No need to test command values this way. There can be only one, even

though the encoding is bit-wise today...
This commit is contained in:
Warner Losh
2015-12-18 05:55:24 +00:00
parent d1e1c4de15
commit 7fef161f23
2 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -236,10 +236,10 @@ nand_strategy(struct bio *bp)
chip = dev->si_drv1;
nand_debug(NDBG_CDEV, "Strategy %s on chip %d [%p]\n",
(bp->bio_cmd & BIO_READ) == BIO_READ ? "READ" : "WRITE",
bp->bio_cmd == BIO_READ ? "READ" : "WRITE",
chip->num, chip);
if ((bp->bio_cmd & BIO_READ) == BIO_READ) {
if (bp->bio_cmd == BIO_READ) {
err = nand_read(chip,
bp->bio_offset & 0xffffffff,
bp->bio_data, bp->bio_bcount);
+11 -11
View File
@@ -100,9 +100,9 @@ nand_strategy(struct bio *bp)
bp->bio_driver1 = BIO_NAND_STD;
nand_debug(NDBG_GEOM, "Strategy %s on chip %d [%p]",
(bp->bio_cmd & BIO_READ) == BIO_READ ? "READ" :
((bp->bio_cmd & BIO_WRITE) == BIO_WRITE ? "WRITE" :
((bp->bio_cmd & BIO_DELETE) == BIO_DELETE ? "DELETE" : "UNKNOWN")),
bp->bio_cmd == BIO_READ ? "READ" :
(bp->bio_cmd == BIO_WRITE ? "WRITE" :
(bp->bio_cmd == BIO_DELETE ? "DELETE" : "UNKNOWN")),
chip->num, chip);
mtx_lock(&chip->qlock);
@@ -122,9 +122,9 @@ nand_strategy_raw(struct bio *bp)
bp->bio_driver1 = BIO_NAND_RAW;
nand_debug(NDBG_GEOM, "Strategy %s on chip %d [%p]",
(bp->bio_cmd & BIO_READ) == BIO_READ ? "READ" :
((bp->bio_cmd & BIO_WRITE) == BIO_WRITE ? "WRITE" :
((bp->bio_cmd & BIO_DELETE) == BIO_DELETE ? "DELETE" : "UNKNOWN")),
bp->bio_cmd == BIO_READ ? "READ" :
(bp->bio_cmd == BIO_WRITE ? "WRITE" :
(bp->bio_cmd == BIO_DELETE ? "DELETE" : "UNKNOWN")),
chip->num, chip);
mtx_lock(&chip->qlock);
@@ -320,21 +320,21 @@ nand_io_proc(void *arg, int pending)
break;
if (bp->bio_driver1 == BIO_NAND_STD) {
if ((bp->bio_cmd & BIO_READ) == BIO_READ) {
if (bp->bio_cmd == BIO_READ) {
err = nand_read(chip,
bp->bio_offset & 0xffffffff,
bp->bio_data, bp->bio_bcount);
} else if ((bp->bio_cmd & BIO_WRITE) == BIO_WRITE) {
} else if (bp->bio_cmd == BIO_WRITE) {
err = nand_write(chip,
bp->bio_offset & 0xffffffff,
bp->bio_data, bp->bio_bcount);
}
} else if (bp->bio_driver1 == BIO_NAND_RAW) {
if ((bp->bio_cmd & BIO_READ) == BIO_READ) {
if (bp->bio_cmd == BIO_READ) {
err = nand_read_raw(chip,
bp->bio_offset & 0xffffffff,
bp->bio_data, bp->bio_bcount);
} else if ((bp->bio_cmd & BIO_WRITE) == BIO_WRITE) {
} else if (bp->bio_cmd == BIO_WRITE) {
err = nand_write_raw(chip,
bp->bio_offset & 0xffffffff,
bp->bio_data, bp->bio_bcount);
@@ -342,7 +342,7 @@ nand_io_proc(void *arg, int pending)
} else
panic("Unknown access type in bio->bio_driver1\n");
if ((bp->bio_cmd & BIO_DELETE) == BIO_DELETE) {
if (bp->bio_cmd == BIO_DELETE) {
nand_debug(NDBG_GEOM, "Delete on chip%d offset %lld "
"length %ld\n", chip->num, bp->bio_offset,
bp->bio_bcount);