block: dma_bdrv_* does not return NULL

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>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Paolo Bonzini 2011-11-14 17:50:53 +01:00 committed by Kevin Wolf
parent 6bee44ea34
commit b9b2008bbf
2 changed files with 1 additions and 9 deletions

View File

@ -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:

View File

@ -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);