From patchwork Mon Nov 14 16:50:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 125566 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 46ED7B71E8 for ; Tue, 15 Nov 2011 04:16:50 +1100 (EST) Received: from localhost ([::1]:33179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPzm4-00005z-Qu for incoming@patchwork.ozlabs.org; Mon, 14 Nov 2011 11:52:48 -0500 Received: from eggs.gnu.org ([140.186.70.92]:32825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPzkc-0004kn-RG for qemu-devel@nongnu.org; Mon, 14 Nov 2011 11:51:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPzkb-0000wq-MU for qemu-devel@nongnu.org; Mon, 14 Nov 2011 11:51:18 -0500 Received: from mail-gx0-f173.google.com ([209.85.161.173]:61768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPzkb-0000vM-GX for qemu-devel@nongnu.org; Mon, 14 Nov 2011 11:51:17 -0500 Received: by mail-gx0-f173.google.com with SMTP id r4so347544ggn.4 for ; Mon, 14 Nov 2011 08:51:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=iHNM9Yc32FZd9aWCmmvVyYj7SOd3sHmzkgrO+TLAULI=; b=tVrlGSKnbyIQiiWJR5d9G8nG3z8ubWtJAdcZSIOE5qx6GbhD9SILZtlpGh6cBRTK34 n+REDnFuOpJZE7Az53me2Io4yMkPvdt42lJkyPz+g+Z8KrLjpbXDwsv+h2TtoplQjyf1 g9/C1ghF2+AQTEeZPGaXzHmShqPpiFmer7dPY= Received: by 10.146.236.17 with SMTP id j17mr2475743yah.10.1321289477211; Mon, 14 Nov 2011 08:51:17 -0800 (PST) Received: from localhost.localdomain (93-34-178-161.ip50.fastwebnet.it. [93.34.178.161]) by mx.google.com with ESMTPS id i31sm40698206anm.19.2011.11.14.08.51.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Nov 2011 08:51:16 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 14 Nov 2011 17:50:53 +0100 Message-Id: <1321289454-9219-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.7.1 In-Reply-To: <1321289454-9219-1-git-send-email-pbonzini@redhat.com> References: <1321289454-9219-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.173 Subject: [Qemu-devel] [PATCH 1.1 5/6] block: dma_bdrv_* does not return NULL 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 Initially attempted with the following semantic patch: @ rule1 @ expression E; statement S; @@ E = ( dma_bdrv_io | dma_bdrv_read | dma_bdrv_write ) (...); ( - if (E == NULL) { ... } | - if (E) { <... S ...> } ) which however did not match anything. Signed-off-by: Paolo Bonzini --- hw/ide/core.c | 6 ------ hw/ide/macio.c | 4 +--- 2 files changed, 1 insertions(+), 9 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 39d945e..600eb28 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -549,7 +549,6 @@ void ide_dma_cb(void *opaque, int ret) int n; int64_t sector_num; -handle_rw_error: if (ret < 0) { int op = BM_STATUS_DMA_RETRY; @@ -608,11 +607,6 @@ handle_rw_error: ide_issue_trim, ide_dma_cb, s, true); break; } - - if (!s->bus->dma->aiocb) { - ret = -1; - goto handle_rw_error; - } return; eot: diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 8965643..43b5ee7 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -152,10 +152,8 @@ static void pmac_ide_transfer_cb(void *opaque, int ret) ide_issue_trim, pmac_ide_transfer_cb, s, true); break; } - - if (!m->aiocb) - pmac_ide_transfer_cb(io, -1); return; + done: if (s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) { bdrv_acct_done(s->bs, &s->acct);