From patchwork Thu May 26 10:56:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 97563 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 51664B6F83 for ; Thu, 26 May 2011 21:14:26 +1000 (EST) Received: from localhost ([::1]:60003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPYWF-0004Cd-8O for incoming@patchwork.ozlabs.org; Thu, 26 May 2011 07:14:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]:37448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPYW2-00047L-OV for qemu-devel@nongnu.org; Thu, 26 May 2011 07:14:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPYW1-0006Y0-KO for qemu-devel@nongnu.org; Thu, 26 May 2011 07:14:10 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:53611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPYW1-0006WT-GB for qemu-devel@nongnu.org; Thu, 26 May 2011 07:14:09 -0400 Received: by mail-wy0-f173.google.com with SMTP id 42so475530wyb.4 for ; Thu, 26 May 2011 04:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=YHBcyMPx+dyCEOG/ToN7mHyUtmu/+lRNnUBatIYdiBU=; b=fd8v8lwV0tY1ghFTdCSdmaxYjLUy+PcMQM84rKkCm/7s952IwG4GSZfsgrF4HDE92y 6aywiNYm+Mf9EwFPmPVj3VnEtULvBi7E7LA9po/fY/JyQ9mw/8y5Vz9G+nPW7TiSEIKw cQ1ddUvac+KYMc5KUrC9N2xu6szBpDnoG/zBI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=svflDre9oUNAsx8espdXgVpB9K7RtyzMPc2K+zSaKpcVGWZ4cqtwZ/UI89nonj8pkX AR2zvqFFLso+pDZDtLwHPYLog+iufRT1T8EJ1+E8ysEewPDFXQmCuPJSb+as+rppg/Z5 t41NyaoVikmDmuIiYJvA6YIH/m5jfZOTiYlag= Received: by 10.216.58.207 with SMTP id q57mr591312wec.63.1306407437805; Thu, 26 May 2011 03:57:17 -0700 (PDT) Received: from localhost.localdomain (93-34-184-88.ip51.fastwebnet.it [93.34.184.88]) by mx.google.com with ESMTPS id k16sm293060wed.8.2011.05.26.03.57.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2011 03:57:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 26 May 2011 12:56:46 +0200 Message-Id: <1306407411-4290-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306407411-4290-1-git-send-email-pbonzini@redhat.com> References: <1306407411-4290-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.173 Subject: [Qemu-devel] [PATCH v5 20/25] scsi: make write_data return void X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The return value is unused anyway. Signed-off-by: Paolo Bonzini Reviewed-by: Christoph Hellwig --- 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 f3eba52..e0c384f 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -269,7 +269,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); @@ -281,7 +281,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; @@ -296,8 +296,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 fc015e0..579bab9 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -277,7 +277,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); @@ -287,16 +287,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 5730faa..b56338d 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);