[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 06/30] ide: simplify set_inactive callbacks
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH v2 06/30] ide: simplify set_inactive callbacks |
Date: |
Mon, 4 Aug 2014 17:11:07 -0400 |
From: Paolo Bonzini <address@hidden>
Drop the unused return value and make the callback optional.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: John Snow <address@hidden>
---
hw/ide/ahci.c | 6 ------
hw/ide/core.c | 5 +++--
hw/ide/internal.h | 2 +-
hw/ide/macio.c | 1 -
hw/ide/pci.c | 4 +---
5 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 273712f..679357f 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1116,11 +1116,6 @@ static int ahci_dma_add_status(IDEDMA *dma, int status)
return 0;
}
-static int ahci_dma_set_inactive(IDEDMA *dma)
-{
- return 0;
-}
-
static int ahci_async_cmd_done(IDEDMA *dma)
{
AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);
@@ -1154,7 +1149,6 @@ static const IDEDMAOps ahci_dma_ops = {
.rw_buf = ahci_dma_rw_buf,
.set_unit = ahci_dma_set_unit,
.add_status = ahci_dma_add_status,
- .set_inactive = ahci_dma_set_inactive,
.async_cmd_done = ahci_async_cmd_done,
.restart_cb = ahci_dma_restart_cb,
};
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 4183a3a..d52a6f6 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -595,7 +595,9 @@ static void ide_async_cmd_done(IDEState *s)
void ide_set_inactive(IDEState *s)
{
s->bus->dma->aiocb = NULL;
- s->bus->dma->ops->set_inactive(s->bus->dma);
+ if (s->bus->dma->ops->set_inactive) {
+ s->bus->dma->ops->set_inactive(s->bus->dma);
+ }
ide_async_cmd_done(s);
}
@@ -2226,7 +2228,6 @@ static const IDEDMAOps ide_dma_nop_ops = {
.rw_buf = ide_nop_int,
.set_unit = ide_nop_int,
.add_status = ide_nop_int,
- .set_inactive = ide_nop,
.restart_cb = ide_nop_restart,
};
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index 6cca46f..34064cf 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -433,7 +433,7 @@ struct IDEDMAOps {
DMAIntFunc *rw_buf;
DMAIntFunc *set_unit;
DMAIntFunc *add_status;
- DMAFunc *set_inactive;
+ DMAVoidFunc *set_inactive;
DMAFunc *async_cmd_done;
DMARestartFunc *restart_cb;
DMAVoidFunc *reset;
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index ca39e3f..0e26bac 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -576,7 +576,6 @@ static const IDEDMAOps dbdma_ops = {
.rw_buf = ide_nop_int,
.set_unit = ide_nop_int,
.add_status = ide_nop_int,
- .set_inactive = ide_nop,
.restart_cb = ide_nop_restart,
};
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index c24496a..9dc3cc5 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -160,15 +160,13 @@ static int bmdma_add_status(IDEDMA *dma, int status)
return 0;
}
-static int bmdma_set_inactive(IDEDMA *dma)
+static void bmdma_set_inactive(IDEDMA *dma)
{
BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma);
bm->status &= ~BM_STATUS_DMAING;
bm->dma_cb = NULL;
bm->unit = -1;
-
- return 0;
}
static void bmdma_restart_dma(BMDMAState *bm, enum ide_dma_cmd dma_cmd)
--
1.9.3
- [Qemu-devel] [PATCH v2 00/30] AHCI test suite framework, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 01/30] blkdebug: report errors on flush too, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 05/30] ide: simplify reset callbacks, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 02/30] libqtest: add QTEST_LOG for debugging qtest testcases, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 07/30] ide: simplify async_cmd_done callbacks, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 03/30] ide-test: add test for werror=stop, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 09/30] ide: wrap start_dma callback, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 08/30] ide: simplify start_transfer callbacks, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 06/30] ide: simplify set_inactive callbacks,
John Snow <=
- [Qemu-devel] [PATCH v2 11/30] ide: fold add_status callback into set_inactive, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 04/30] ide: stash aiocb for flushes, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 10/30] ide: remove wrong setting of BM_STATUS_INT, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 13/30] ide: move retry constants out of BM_STATUS_* namespace, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 12/30] ide: move BM_STATUS bits to pci.[ch], John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 18/30] q35: Enable the ioapic device to be seen by qtest., John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 16/30] ide: make all commands go through cmd_done, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 15/30] ide: stop PIO transfer on errors, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 17/30] ahci: construct PIO Setup FIS for PIO commands, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 14/30] ahci: remove duplicate PORT_IRQ_* constants, John Snow, 2014/08/04