Received: from eggs.gnu.org ([140.186.70.92]:42155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbBxJ-0000dL-Oo for qemu-devel@nongnu.org; Thu, 15 Dec 2011 09:06:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbBx7-0004cV-65 for qemu-devel@nongnu.org; Thu, 15 Dec 2011 09:06:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbBx6-0004cM-T5 for qemu-devel@nongnu.org; Thu, 15 Dec 2011 09:06:29 -0500 From: Kevin Wolf Date: Thu, 15 Dec 2011 15:09:20 +0100 Message-Id: <1323958169-8333-6-git-send-email-kwolf@redhat.com> In-Reply-To: <1323958169-8333-1-git-send-email-kwolf@redhat.com> References: <1323958169-8333-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 05/14] block: dma_bdrv_* does not return NULL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Paolo Bonzini 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 Signed-off-by: Kevin Wolf --- 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 7071326..de9ed41 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 40f60f0..abbc41b 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); -- 1.7.6.4