summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Fritsch <sf@cvs.openbsd.org>2015-12-05 19:55:34 +0000
committerStefan Fritsch <sf@cvs.openbsd.org>2015-12-05 19:55:34 +0000
commitcaba86b9483ef1d167d209c878b2b9303204337d (patch)
tree7a0df221004fd18d0104efbc407c1cd3ffa3a1b2 /sys
parent8d95c36fafa7077c7185a46c72817e65c9fd2fd8 (diff)
make vioblk_scsi_cmd more normal
Declare all variables at the start of the function and get rid of the strangely-indented block around the second half of the function.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/vioblk.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/sys/dev/pci/vioblk.c b/sys/dev/pci/vioblk.c
index d438736b8c5..a35a07c1853 100644
--- a/sys/dev/pci/vioblk.c
+++ b/sys/dev/pci/vioblk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vioblk.c,v 1.7 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: vioblk.c,v 1.8 2015/12/05 19:55:33 sf Exp $ */
/*
* Copyright (c) 2012 Stefan Fritsch.
@@ -308,6 +308,12 @@ vioblk_vq_done1(struct vioblk_softc *sc, struct virtio_softc *vsc,
void
vioblk_scsi_cmd(struct scsi_xfer *xs)
{
+ struct vioblk_softc *sc = xs->sc_link->adapter_softc;
+ struct virtqueue *vq = &sc->sc_vq[0];
+ struct virtio_softc *vsc = sc->sc_virtio;
+ struct virtio_blk_req *vr;
+ int len, s, timeout, isread, slot, ret, nsegs;
+ int error = XS_NO_CCB;
struct scsi_rw *rw;
struct scsi_rw_big *rwb;
struct scsi_rw_12 *rw12;
@@ -315,7 +321,6 @@ vioblk_scsi_cmd(struct scsi_xfer *xs)
u_int64_t lba = 0;
u_int32_t sector_count;
uint8_t operation;
- int isread;
switch (xs->cmd->opcode) {
case READ_BIG:
@@ -384,16 +389,6 @@ vioblk_scsi_cmd(struct scsi_xfer *xs)
sector_count = _4btol(rw16->length);
}
-{
- struct vioblk_softc *sc = xs->sc_link->adapter_softc;
- struct virtqueue *vq = &sc->sc_vq[0];
- struct virtio_blk_req *vr;
- struct virtio_softc *vsc = sc->sc_virtio;
- int len, s;
- int timeout;
- int slot, ret, nsegs;
- int error = XS_NO_CCB;
-
s = splbio();
ret = virtio_enqueue_prep(vq, &slot);
if (ret) {
@@ -477,7 +472,6 @@ out_done:
vr->vr_len = VIOBLK_DONE;
splx(s);
}
-}
void
vioblk_scsi_inq(struct scsi_xfer *xs)