From 1b1a1ad0c9778464996c6203b8251798eae30fb9 Mon Sep 17 00:00:00 2001 From: matthew Date: Sat, 24 Jul 2010 20:15:31 +0000 Subject: [PATCH] Restore a needed 'return' removed in the last commit, and stylistic tweak to eliminate an 'else' clause. --- sys/dev/vscsi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index fc0d89b536e..aac21711193 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.16 2010/07/24 11:53:44 dlg Exp $ */ +/* $OpenBSD: vscsi.c,v 1.17 2010/07/24 20:15:31 matthew Exp $ */ /* * Copyright (c) 2008 David Gwynne @@ -167,22 +167,23 @@ vscsi_cmd(struct scsi_xfer *xs) struct vscsi_softc *sc = link->adapter_softc; struct vscsi_ccb *ccb = xs->io; int polled = ISSET(xs->flags, SCSI_POLL); - int running = 1; + int running = 0; if (ISSET(xs->flags, SCSI_POLL) && ISSET(xs->flags, SCSI_NOSLEEP)) { printf("%s: POLL && NOSLEEP for 0x%02x\n", DEVNAME(sc), xs->cmd->opcode); xs->error = XS_DRIVER_STUFFUP; scsi_done(xs); + return; } ccb->ccb_xs = xs; mtx_enter(&sc->sc_state_mtx); - if (sc->sc_state == VSCSI_S_RUNNING) + if (sc->sc_state == VSCSI_S_RUNNING) { + running = 1; TAILQ_INSERT_TAIL(&sc->sc_ccb_i2t, ccb, ccb_entry); - else - running = 0; + } mtx_leave(&sc->sc_state_mtx); if (!running) { -- 2.20.1