From patchwork Sat Dec 18 20:00:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 76097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 93C87B70AF for ; Sun, 19 Dec 2010 07:01:47 +1100 (EST) Received: from localhost ([127.0.0.1]:36308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PU2yK-0003xL-2L for incoming@patchwork.ozlabs.org; Sat, 18 Dec 2010 15:01:40 -0500 Received: from [140.186.70.92] (port=34079 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PU2xT-0003w6-Br for qemu-devel@nongnu.org; Sat, 18 Dec 2010 15:00:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PU2xR-0008CW-NS for qemu-devel@nongnu.org; Sat, 18 Dec 2010 15:00:47 -0500 Received: from mail-pz0-f53.google.com ([209.85.210.53]:60416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PU2xR-0008CM-Er for qemu-devel@nongnu.org; Sat, 18 Dec 2010 15:00:45 -0500 Received: by pzk37 with SMTP id 37so387238pzk.12 for ; Sat, 18 Dec 2010 12:00:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=BdE8cWvALEIJ7v4bYx3I8C+Mk6JU+9Tb7555adDO9eU=; b=giiIk8wEdnnQVjJQnPC+c7NMVg0iynyjFoFERn2h8A63Gdic8f1DyWJI429DnOv6Mp tuO2YcyF347IP8yGIua8v7Lhq2XQw/YsFL4Q9F59S5crCV051Wt3bwMNwf40xfpwIYSx FAAs8mrDsVYfD+6TDjVq99slPDM51J8Hwpy2M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=m123ZVj2wNz0MRoUE7sujD9Jup+Pe236hSGMmAFbzgqp9lMfMvxsNK6LJZcHDOqE3a tMISeMGAEpY6h1nD64wwwRNsQoCnTHy8kcbfu5FHodiunzVbsPIaoPw111/jjN6SkYup U/1q/socSprUPfY6xhF+NjiEHSVCN9tDIkk9c= Received: by 10.142.128.6 with SMTP id a6mr551572wfd.290.1292702444537; Sat, 18 Dec 2010 12:00:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.136.4 with HTTP; Sat, 18 Dec 2010 12:00:24 -0800 (PST) From: Blue Swirl Date: Sat, 18 Dec 2010 20:00:24 +0000 Message-ID: To: Alexander Graf , Kevin Wolf , qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Subject: [Qemu-devel] [PATCH 2/2] ahci: delete write-only variables (v2) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Avoid these warnings with GCC 4.6.0: /src/qemu/hw/ide/ahci.c: In function 'ahci_reset_port': /src/qemu/hw/ide/ahci.c:810:14: error: variable 'tfd' set but not used [-Werror=unused-but-set-variable] /src/qemu/hw/ide/ahci.c: In function 'handle_cmd': /src/qemu/hw/ide/ahci.c:1103:19: error: variable 'pr' set but not used [-Werror=unused-but-set-variable] In the tfd variable case, fix the logic also. CC: Alexander Graf CC: Kevin Wolf Signed-off-by: Blue Swirl Acked-by: Alexander Graf --- hw/ide/ahci.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) AHCICmdHdr *cmd; @@ -1113,7 +1111,6 @@ static int handle_cmd(AHCIState *s, int port, int slot) return -1; } - pr = &s->dev[port].port_regs; cmd = &((AHCICmdHdr *)s->dev[port].lst)[slot]; if (!s->dev[port].lst) { diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 8ae236a..968fdce 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -807,7 +807,6 @@ static void ahci_reset_port(AHCIState *s, int port) AHCIPortRegs *pr = &d->port_regs; IDEState *ide_state = &d->port.ifs[0]; uint8_t init_fis[0x20]; - uint32_t tfd; int i; DPRINTF(port, "reset port\n"); @@ -848,7 +847,7 @@ static void ahci_reset_port(AHCIState *s, int port) s->dev[port].port_state = STATE_RUN; if (!ide_state->bs) { s->dev[port].port_regs.sig = 0; - tfd = (1 << 8) | SEEK_STAT | WRERR_STAT; + ide_state->status = SEEK_STAT | WRERR_STAT; } else if (ide_state->drive_kind == IDE_CD) { s->dev[port].port_regs.sig = SATA_SIGNATURE_CDROM; ide_state->lcyl = 0x14; @@ -1100,7 +1099,6 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis, static int handle_cmd(AHCIState *s, int port, int slot) { IDEState *ide_state; - AHCIPortRegs *pr; uint32_t opts; uint64_t tbl_addr;