From patchwork Fri Jan 4 19:44:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Baron X-Patchwork-Id: 209526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5CEE82C0082 for ; Sat, 5 Jan 2013 06:45:02 +1100 (EST) Received: from localhost ([::1]:42429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrDCO-0003yi-IX for incoming@patchwork.ozlabs.org; Fri, 04 Jan 2013 14:45:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrDCB-0003yB-CR for qemu-devel@nongnu.org; Fri, 04 Jan 2013 14:44:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrDC8-0005Vy-Va for qemu-devel@nongnu.org; Fri, 04 Jan 2013 14:44:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrDC8-0005Vc-Nj for qemu-devel@nongnu.org; Fri, 04 Jan 2013 14:44:44 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r04Jifmd008517 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Jan 2013 14:44:42 -0500 Received: from redhat.com (dhcp-185-114.bos.redhat.com [10.16.185.114]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r04JifFe014708; Fri, 4 Jan 2013 14:44:41 -0500 Date: Fri, 4 Jan 2013 14:44:41 -0500 From: Jason Baron To: kwolf@redhat.com, afaerber@suse.de, agraf@suse.de Message-Id: <059dba42dd5bac13a2e03b634d13f27c57ba2e1e.1357327435.git.jbaron@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: i.mitsyanko@samsung.com, quintela@redhat.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org, aderumier@odiso.com, yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH v3 1/2] ahci: remove unused AHCIDevice fields X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jason Baron 'dma_status' and 'dma_cb' are written to, but never read. Remove these fields in preparation for AHCI migration bits. Signed-off-by: Jason Baron Reviewed-by: Juan Quintela --- hw/ide/ahci.c | 8 ++------ hw/ide/ahci.h | 2 -- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index d072449..72cd1c8 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1035,11 +1035,10 @@ out: static void ahci_start_dma(IDEDMA *dma, IDEState *s, BlockDriverCompletionFunc *dma_cb) { +#ifdef DEBUG_AHCI AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma); - +#endif DPRINTF(ad->port_no, "\n"); - ad->dma_cb = dma_cb; - ad->dma_status |= BM_STATUS_DMAING; s->io_buffer_offset = 0; dma_cb(s, 0); } @@ -1095,7 +1094,6 @@ static int ahci_dma_set_unit(IDEDMA *dma, int unit) static int ahci_dma_add_status(IDEDMA *dma, int status) { AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma); - ad->dma_status |= status; DPRINTF(ad->port_no, "set status: %x\n", status); if (status & BM_STATUS_INT) { @@ -1114,8 +1112,6 @@ static int ahci_dma_set_inactive(IDEDMA *dma) /* update d2h status */ ahci_write_fis_d2h(ad, NULL); - ad->dma_cb = NULL; - if (!ad->check_bh) { /* maybe we still have something to process, check later */ ad->check_bh = qemu_bh_new(ahci_check_cmd_bh, ad); diff --git a/hw/ide/ahci.h b/hw/ide/ahci.h index 1200a56..735b379 100644 --- a/hw/ide/ahci.h +++ b/hw/ide/ahci.h @@ -281,11 +281,9 @@ struct AHCIDevice { QEMUBH *check_bh; uint8_t *lst; uint8_t *res_fis; - int dma_status; int done_atapi_packet; int busy_slot; int init_d2h_sent; - BlockDriverCompletionFunc *dma_cb; AHCICmdHdr *cur_cmd; NCQTransferState ncq_tfs[AHCI_MAX_CMDS]; };