From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMI3O-0005uY-1e for qemu-devel@nongnu.org; Tue, 17 May 2011 07:04:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMI2b-00054u-1Y for qemu-devel@nongnu.org; Tue, 17 May 2011 07:03:05 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:61697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMI2a-0004zI-Un for qemu-devel@nongnu.org; Tue, 17 May 2011 07:02:17 -0400 Received: by mail-iw0-f173.google.com with SMTP id 42so369736iwl.4 for ; Tue, 17 May 2011 04:02:16 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 17 May 2011 13:01:05 +0200 Message-Id: <1305630067-2119-20-git-send-email-pbonzini@redhat.com> In-Reply-To: <1305630067-2119-1-git-send-email-pbonzini@redhat.com> References: <1305630067-2119-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v3 19/21] scsi: make write_data return void List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The return value is unused anyway. Signed-off-by: Paolo Bonzini --- hw/scsi-disk.c | 6 ++---- hw/scsi-generic.c | 7 ++----- hw/scsi.h | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 65744c7..4c7a53e 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -267,7 +267,7 @@ static void scsi_write_complete(void * opaque, int ret) } } -static int scsi_write_data(SCSIRequest *req) +static void scsi_write_data(SCSIRequest *req) { SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req); SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); @@ -279,7 +279,7 @@ static int scsi_write_data(SCSIRequest *req) if (r->req.cmd.mode != SCSI_XFER_TO_DEV) { DPRINTF("Data transfer direction invalid\n"); scsi_write_complete(r, -EINVAL); - return 0; + return; } n = r->iov.iov_len / 512; @@ -294,8 +294,6 @@ static int scsi_write_data(SCSIRequest *req) /* Invoke completion routine to fetch data from host. */ scsi_write_complete(r, 0); } - - return 0; } static void scsi_dma_restart_bh(void *opaque) diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index a4de39d..1ea0930 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -275,7 +275,7 @@ static void scsi_write_complete(void * opaque, int ret) /* Write data to a scsi device. Returns nonzero on failure. The transfer may complete asynchronously. */ -static int scsi_write_data(SCSIRequest *req) +static void scsi_write_data(SCSIRequest *req) { SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, req->dev); SCSIGenericReq *r = DO_UPCAST(SCSIGenericReq, req, req); @@ -285,16 +285,13 @@ static int scsi_write_data(SCSIRequest *req) if (r->len == 0) { r->len = r->buflen; scsi_req_data(&r->req, r->len); - return 0; + return; } ret = execute_command(s->bs, r, SG_DXFER_TO_DEV, scsi_write_complete); if (ret < 0) { scsi_command_complete(r, ret); - return 1; } - - return 0; } /* Return a pointer to the data buffer. */ diff --git a/hw/scsi.h b/hw/scsi.h index dbb69ef..7eed475 100644 --- a/hw/scsi.h +++ b/hw/scsi.h @@ -77,7 +77,7 @@ struct SCSIDeviceInfo { void (*free_req)(SCSIRequest *req); int32_t (*send_command)(SCSIRequest *req, uint8_t *buf); void (*read_data)(SCSIRequest *req); - int (*write_data)(SCSIRequest *req); + void (*write_data)(SCSIRequest *req); void (*cancel_io)(SCSIRequest *req); uint8_t *(*get_buf)(SCSIRequest *req); int (*get_sense)(SCSIRequest *req, uint8_t *buf, int len); -- 1.7.4.4