From ad54ae80c73f486cf39b4b38a04b76dd971cdbf6 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 30 Nov 2011 09:12:30 +0100 Subject: block: bdrv_aio_* do not return NULL Initially done with the following semantic patch: @ rule1 @ expression E; statement S; @@ E = ( bdrv_aio_readv | bdrv_aio_writev | bdrv_aio_flush | bdrv_aio_discard | bdrv_aio_ioctl ) (...); ( - if (E == NULL) { ... } | - if (E) { <... S ...> } ) which however missed the occurrence in block/blkverify.c (as it should have done), and left behind some unused variables. Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- hw/ide/atapi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'hw/ide/atapi.c') diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 8af1cfdd7e..0adb27b799 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -352,14 +352,8 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret) s->bus->dma->aiocb = bdrv_aio_readv(s->bs, (int64_t)s->lba << 2, &s->bus->dma->qiov, n * 4, ide_atapi_cmd_read_dma_cb, s); - if (!s->bus->dma->aiocb) { - /* Note: media not present is the most likely case */ - ide_atapi_cmd_error(s, NOT_READY, - ASC_MEDIUM_NOT_PRESENT); - goto eot; - } - return; + eot: bdrv_acct_done(s->bs, &s->acct); s->bus->dma->ops->add_status(s->bus->dma, BM_STATUS_INT); -- cgit v1.2.1