From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VapvH-0007Td-DK for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vapv8-0000Nl-B0 for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:44:11 -0400 Received: from mail-qc0-x230.google.com ([2607:f8b0:400d:c01::230]:36160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vapv8-0000Nf-6H for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:44:02 -0400 Received: by mail-qc0-f176.google.com with SMTP id s19so3916337qcw.21 for ; Mon, 28 Oct 2013 09:44:01 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 28 Oct 2013 17:43:22 +0100 Message-Id: <1382978620-16641-7-git-send-email-pbonzini@redhat.com> In-Reply-To: <1382978620-16641-1-git-send-email-pbonzini@redhat.com> References: <1382978620-16641-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 06/24] ide: simplify set_inactive callbacks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com Drop the unused return value and make the callback optional. Signed-off-by: Paolo Bonzini --- hw/ide/ahci.c | 8 -------- 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(+), 15 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index d74b6ab..265e3f2 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1106,11 +1106,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); @@ -1125,8 +1120,6 @@ static int ahci_async_cmd_done(IDEDMA *dma) ad->check_bh = qemu_bh_new(ahci_check_cmd_bh, ad); qemu_bh_schedule(ad->check_bh); } - - return 0; } static void ahci_irq_set(void *opaque, int n, int level) @@ -1144,7 +1137,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 8437ead..926b90a 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -578,7 +578,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); } @@ -2195,7 +2197,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 84f3a7a..7c68f8e 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 b3cb6ca..013326d 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -526,7 +526,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 a9eb5bf..b781149 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.8.3.1