Received: from eggs.gnu.org ([2001:4830:134:3::10]:42449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vapvq-0008QP-C6 for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:44:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vapvh-0000Xz-UK for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:44:46 -0400 Received: from mail-qe0-x232.google.com ([2607:f8b0:400d:c02::232]:44758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vapvh-0000Xv-QN for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:44:37 -0400 Received: by mail-qe0-f50.google.com with SMTP id 1so4088132qee.23 for ; Mon, 28 Oct 2013 09:44:37 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 28 Oct 2013 17:43:40 +0100 Message-Id: <1382978620-16641-25-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 24/24] ide: commonize io_buffer_index initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com Signed-off-by: Paolo Bonzini --- hw/ide/atapi.c | 2 -- hw/ide/core.c | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 6b3f6c1..249b8b1 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -250,7 +250,6 @@ static void ide_atapi_cmd_reply(IDEState *s, int size, int max_size) s->packet_transfer_size = size; s->io_buffer_size = size; /* dma: send the reply data as one chunk */ s->elementary_transfer_size = 0; - s->io_buffer_index = 0; if (s->atapi_dma) { bdrv_acct_start(s->bs, &s->acct, size, BDRV_ACCT_READ); @@ -368,7 +367,6 @@ static void ide_atapi_cmd_read_dma(IDEState *s, int lba, int nb_sectors, { s->lba = lba; s->packet_transfer_size = nb_sectors * sector_size; - s->io_buffer_index = 0; s->io_buffer_size = 0; s->cd_sector_size = sector_size; diff --git a/hw/ide/core.c b/hw/ide/core.c index 01deeeb..c3817bd 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -705,7 +705,6 @@ eot: static void ide_sector_start_dma(IDEState *s, enum ide_dma_cmd dma_cmd) { s->status = READY_STAT | SEEK_STAT | DRQ_STAT | BUSY_STAT; - s->io_buffer_index = 0; s->io_buffer_size = 0; s->dma_cmd = dma_cmd; @@ -727,6 +726,7 @@ static void ide_sector_start_dma(IDEState *s, enum ide_dma_cmd dma_cmd) void ide_start_dma(IDEState *s, BlockDriverCompletionFunc *cb) { + s->io_buffer_index = 0; s->bus->retry_unit = s->unit; s->bus->retry_sector_num = ide_get_sector(s); s->bus->retry_nsector = s->nsector; @@ -2199,7 +2199,6 @@ static void ide_restart_dma(IDEState *s, enum ide_dma_cmd dma_cmd) ide_set_sector(s, s->bus->retry_sector_num); s->nsector = s->bus->retry_nsector; s->bus->dma->ops->restart_dma(s->bus->dma); - s->io_buffer_index = 0; s->io_buffer_size = 0; s->dma_cmd = dma_cmd; ide_start_dma(s, ide_dma_cb); -- 1.8.3.1