From 43cf8ae69ba8510e45d7bd42dd67bc8ae13c48ec Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 27 Mar 2012 13:42:23 +1100 Subject: Use DMADirection type for dma_bdrv_io MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently dma_bdrv_io() takes a 'to_dev' boolean parameter to determine the direction of DMA it is emulating. We already have a DMADirection enum designed specifically to encode DMA directions. This patch uses it for dma_bdrv_io() as well. This involves removing the DMADirection definition from the #ifdef it was inside, but since that only existed to protect the definition of dma_addr_t from places where config.h is not included, there wasn't any reason for it to be there in the first place. Signed-off-by: David Gibson Reviewed-by: Stefan Hajnoczi Reviewed-by: Andreas Färber Signed-off-by: Kevin Wolf --- hw/ide/core.c | 3 ++- hw/ide/macio.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'hw') diff --git a/hw/ide/core.c b/hw/ide/core.c index 6e25338..35723fd 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -618,7 +618,8 @@ void ide_dma_cb(void *opaque, int ret) break; case IDE_DMA_TRIM: s->bus->dma->aiocb = dma_bdrv_io(s->bs, &s->sg, sector_num, - ide_issue_trim, ide_dma_cb, s, true); + ide_issue_trim, ide_dma_cb, s, + DMA_DIRECTION_TO_DEVICE); break; } return; diff --git a/hw/ide/macio.c b/hw/ide/macio.c index a4df244..7b38d9e 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -149,7 +149,8 @@ static void pmac_ide_transfer_cb(void *opaque, int ret) break; case IDE_DMA_TRIM: m->aiocb = dma_bdrv_io(s->bs, &s->sg, sector_num, - ide_issue_trim, pmac_ide_transfer_cb, s, true); + ide_issue_trim, pmac_ide_transfer_cb, s, + DMA_DIRECTION_TO_DEVICE); break; } return; -- cgit v1.1