summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-20 04:37:55 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-20 04:37:55 +0000
commit82eb8c92d3a611e19bea5ab3a2123a825c64d67a (patch)
tree9e36c1d7b61c2c31c4309da176c61a80ddb05eb7
parente9305838eaf52a590c3d0b70b2ee331b6069d895 (diff)
Doh. Setting ITSDONE and returning SUCCESSFULLY_QUEUED just means
there is another splbio()/splx and a check for ITSDONE before falling into the COMPLETE case. So just return COMPLETE if the command has completed (or never started). Simpler all around.
-rw-r--r--sys/dev/usb/umass_scsi.c12
-rw-r--r--sys/dev/usb/usscanner.c10
2 files changed, 6 insertions, 16 deletions
diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c
index 56c781b3b0a..7783397d114 100644
--- a/sys/dev/usb/umass_scsi.c
+++ b/sys/dev/usb/umass_scsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umass_scsi.c,v 1.20 2007/10/20 03:37:05 krw Exp $ */
+/* $OpenBSD: umass_scsi.c,v 1.21 2007/10/20 04:37:54 krw Exp $ */
/* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -180,7 +180,7 @@ umass_scsi_cmd(struct scsi_xfer *xs)
struct umass_softc *sc = sc_link->adapter_softc;
struct scsi_generic *cmd;
- int cmdlen, dir, rslt, s;
+ int cmdlen, dir, s;
#ifdef UMASS_DEBUG
microtime(&sc->tv);
@@ -277,16 +277,10 @@ umass_scsi_cmd(struct scsi_xfer *xs)
/* Return if command finishes early. */
done:
xs->flags |= ITSDONE;
- if (xs->flags & SCSI_POLL)
- rslt = COMPLETE;
- else
- rslt = SUCCESSFULLY_QUEUED;
-
s = splbio();
scsi_done(xs);
splx(s);
-
- return (rslt);
+ return (COMPLETE);
}
void
diff --git a/sys/dev/usb/usscanner.c b/sys/dev/usb/usscanner.c
index afba064fcd8..6b3055c2669 100644
--- a/sys/dev/usb/usscanner.c
+++ b/sys/dev/usb/usscanner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usscanner.c,v 1.25 2007/10/20 04:01:39 krw Exp $ */
+/* $OpenBSD: usscanner.c,v 1.26 2007/10/20 04:37:54 krw Exp $ */
/* $NetBSD: usscanner.c,v 1.6 2001/01/23 14:04:14 augustss Exp $ */
/*
@@ -717,7 +717,7 @@ usscanner_scsipi_cmd(struct scsipi_xfer *xs)
struct scsipi_link *sc_link = xs->sc_link;
struct usscanner_softc *sc = sc_link->adapter_softc;
usbd_status err;
- int rslt, s;
+ int s;
#ifdef notyet
DPRINTFN(8, ("%s: usscanner_scsi_cmd: %d:%d "
@@ -773,13 +773,9 @@ usscanner_scsipi_cmd(struct scsipi_xfer *xs)
done:
sc->sc_state = UAS_IDLE;
xs->xs_control |= XS_STS_DONE;
- if (xs->xs_control & XS_CTL_POLL)
- rslt = COMPLETE;
- else
- rslt = SUCCESSFULLY_QUEUED;
s = splbio();
scsipi_done(xs);
splx(s);
- return (rslt);
+ return (COMPLETE);
}