summaryrefslogtreecommitdiff
path: root/sys/scsi
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2019-09-10 18:45:46 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2019-09-10 18:45:46 +0000
commitb8b7454d51c0a4004dc464b22c38d3b1c5e7acf1 (patch)
tree02a9b4a2c5f1b3459312711eb09637eca47d0951 /sys/scsi
parent9b727a2a8c6ae3c11d7e3b5f7b4dec7db1ffb047 (diff)
Explicitly check error results against 0.
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/st.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index cfbbd2cc432..84463b4e9eb 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.161 2019/09/10 16:55:42 krw Exp $ */
+/* $OpenBSD: st.c,v 1.162 2019/09/10 18:45:45 krw Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -402,14 +402,14 @@ stopen(dev_t dev, int flags, int fmt, struct proc *p)
if (!ISSET(link->flags, SDEV_MEDIA_LOADED))
st_unmount(st, NOEJECT, DOREWIND);
- if (error) {
+ if (error != 0) {
CLR(link->flags, SDEV_OPEN);
goto done;
}
if (!ISSET(st->flags, ST_MOUNTED)) {
error = st_mount_tape(dev, flags);
- if (error) {
+ if (error != 0) {
CLR(link->flags, SDEV_OPEN);
goto done;
}
@@ -1081,7 +1081,7 @@ stioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
* (to get the current state of READONLY)
*/
error = st_mode_sense(st, SCSI_SILENT);
- if (error)
+ if (error != 0)
break;
SC_DEBUG(st->sc_link, SDEV_DB1, ("[ioctl: get status]\n"));
@@ -1572,7 +1572,7 @@ st_space(struct st_softc *st, int number, u_int what, int flags)
*/
error = st_space(st, 0, SP_FILEMARKS,
flags);
- if (error)
+ if (error != 0)
return error;
}
if (ISSET(st->flags, ST_BLANK_READ)) {
@@ -1779,7 +1779,7 @@ st_load(struct st_softc *st, u_int type, int flags)
if (type != LD_LOAD) {
error = st_check_eod(st, 0, &nmarks, flags);
- if (error)
+ if (error != 0)
return (error);
}
@@ -1821,7 +1821,7 @@ st_rewind(struct st_softc *st, u_int immediate, int flags)
int error, nmarks;
error = st_check_eod(st, 0, &nmarks, flags);
- if (error)
+ if (error != 0)
return (error);
CLR(st->flags, ST_PER_ACTION);