summaryrefslogtreecommitdiff
path: root/sys/scsi/scsi_ioctl.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2019-11-23 17:10:14 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2019-11-23 17:10:14 +0000
commit9fadecf60bd7f802122c82e0248c7b864b60894f (patch)
treeb469c9dbb48d4e529c6313df873b801ac1dc2e7d /sys/scsi/scsi_ioctl.c
parenta6babe8ae9995ae1fdfa6ecfd8d503477d048e17 (diff)
Consistently use ISSET() to check for set flags.
Diffstat (limited to 'sys/scsi/scsi_ioctl.c')
-rw-r--r--sys/scsi/scsi_ioctl.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c
index ce51ac62180..28fade5edfc 100644
--- a/sys/scsi/scsi_ioctl.c
+++ b/sys/scsi/scsi_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_ioctl.c,v 1.61 2019/11/23 12:27:32 krw Exp $ */
+/* $OpenBSD: scsi_ioctl.c,v 1.62 2019/11/23 17:10:13 krw Exp $ */
/* $NetBSD: scsi_ioctl.c,v 1.23 1996/10/12 23:23:17 christos Exp $ */
/*
@@ -121,9 +121,9 @@ scsi_ioc_cmd(struct scsi_link *link, scsireq_t *screq)
xs->datalen = screq->datalen;
}
- if (screq->flags & SCCMD_READ)
+ if (ISSET(screq->flags, SCCMD_READ))
SET(xs->flags, SCSI_DATA_IN);
- if (screq->flags & SCCMD_WRITE) {
+ if (ISSET(screq->flags, SCCMD_WRITE)) {
if (screq->datalen > 0) {
err = copyin(screq->databuf, xs->data, screq->datalen);
if (err != 0)
@@ -176,7 +176,7 @@ scsi_ioc_cmd(struct scsi_link *link, scsireq_t *screq)
break;
}
- if (screq->datalen > 0 && screq->flags & SCCMD_READ) {
+ if (screq->datalen > 0 && ISSET(screq->flags, SCCMD_READ)) {
err = copyout(xs->data, screq->databuf, screq->datalen);
if (err != 0)
goto err;
@@ -208,7 +208,7 @@ scsi_ioc_ata_cmd(struct scsi_link *link, atareq_t *atareq)
cdb->opcode = ATA_PASSTHRU_12;
if (atareq->datalen > 0) {
- if (atareq->flags & ATACMD_READ) {
+ if (ISSET(atareq->flags, ATACMD_READ)) {
cdb->count_proto = ATA_PASSTHRU_PROTO_PIO_DATAIN;
cdb->flags = ATA_PASSTHRU_T_DIR_READ;
} else {
@@ -239,9 +239,9 @@ scsi_ioc_ata_cmd(struct scsi_link *link, atareq_t *atareq)
xs->datalen = atareq->datalen;
}
- if (atareq->flags & ATACMD_READ)
+ if (ISSET(atareq->flags, ATACMD_READ))
SET(xs->flags, SCSI_DATA_IN);
- if (atareq->flags & ATACMD_WRITE) {
+ if (ISSET(atareq->flags, ATACMD_WRITE)) {
if (atareq->datalen > 0) {
err = copyin(atareq->databuf, xs->data,
atareq->datalen);
@@ -271,7 +271,7 @@ scsi_ioc_ata_cmd(struct scsi_link *link, atareq_t *atareq)
break;
}
- if (atareq->datalen > 0 && atareq->flags & ATACMD_READ) {
+ if (atareq->datalen > 0 && ISSET(atareq->flags, ATACMD_READ)) {
err = copyout(xs->data, atareq->databuf, atareq->datalen);
if (err != 0)
goto err;