From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1.1 5/6] block: dma_bdrv_* does not return NULL
Date: Mon, 14 Nov 2011 17:50:53 +0100 [thread overview]
Message-ID: <1321289454-9219-6-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1321289454-9219-1-git-send-email-pbonzini@redhat.com>
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 <pbonzini@redhat.com>
---
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);
--
1.7.7.1
next prev parent reply other threads:[~2011-11-14 16:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 16:50 [Qemu-devel] [PATCH 1.1 0/6] block: drop useless checks for NULL Paolo Bonzini
2011-11-14 16:50 ` [Qemu-devel] [PATCH 1.1 1/6] block: bdrv_aio_* do not return NULL Paolo Bonzini
2011-11-14 16:50 ` [Qemu-devel] [PATCH 1.1 2/6] block: simplify failure handling for bdrv_aio_multiwrite Paolo Bonzini
2011-11-14 16:50 ` [Qemu-devel] [PATCH 1.1 3/6] block: qemu_aio_get does not return NULL Paolo Bonzini
2011-11-14 16:50 ` [Qemu-devel] [PATCH 1.1 4/6] dma: the passed io_func " Paolo Bonzini
2011-11-14 16:50 ` Paolo Bonzini [this message]
2011-11-14 16:50 ` [Qemu-devel] [PATCH 1.1 6/6] block: avoid useless checks on acb->bh Paolo Bonzini
2011-11-30 8:12 ` [Qemu-devel] [PATCH 1.1 v2] block: bdrv_aio_* do not return NULL Paolo Bonzini
2011-11-30 8:12 ` [Qemu-devel] [PATCH 1.1 0/6] block: drop useless checks for NULL Paolo Bonzini
2011-12-05 16:56 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1321289454-9219-6-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).