From patchwork Sun May 8 06:58:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 94536 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2D3ABB7159 for ; Sun, 8 May 2011 16:58:30 +1000 (EST) Received: from localhost ([::1]:45767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIxwg-0001ge-Mi for incoming@patchwork.ozlabs.org; Sun, 08 May 2011 02:58:26 -0400 Received: from eggs.gnu.org ([140.186.70.92]:56050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIxwY-0001gN-04 for qemu-devel@nongnu.org; Sun, 08 May 2011 02:58:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIxwW-0004zs-UG for qemu-devel@nongnu.org; Sun, 08 May 2011 02:58:17 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:49235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIxwW-0004zk-GI; Sun, 08 May 2011 02:58:16 -0400 Received: from flocke.fritz.box (p54ADA2B4.dip.t-dialin.net [84.173.162.180]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LvxEH-1Pgsvo1zTB-017iKQ; Sun, 08 May 2011 08:58:13 +0200 Received: from stefan by flocke.fritz.box with local (Exim 4.72) (envelope-from ) id 1QIxwS-0007RN-CN; Sun, 08 May 2011 08:58:12 +0200 From: Stefan Weil To: QEMU Developers Date: Sun, 8 May 2011 08:58:11 +0200 Message-Id: <1304837891-28573-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.7.2.5 X-Provags-ID: V02:K0:n5CAwPvPYIxYZlZOBw4QfGtMvtJKWe8jGoBOBn2XZem QxPLGFZfEz/rvrWzH8uad0d0QGeaQYvuWGBNq8NRVDFH9HTCk2 Un9kZK+lTmZVuJbho2rhgJDoGm7xfysyM9KO7giQSGMXA95Njl d5DYeF0DMm1TUiQkvgpTV7ZpxQ5YkZ5fUWoqvpZX3gGbnQ3k5Q lKEX3mR9Ss8oRSWKjwZ1Qxlfs8CHoZvCf6zyczkQhShSadOAtc prZrupuWZamrU X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.187 Cc: qemu-trivial@nongnu.org Subject: [Qemu-devel] [PATCH] ac97: Remove unused local variables 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 cppcheck report: hw/ac97.c:1004: style: Variable 'written' is assigned a value that is never used hw/ac97.c:1072: style: Variable 'written' is assigned a value that is never used Signed-off-by: Stefan Weil --- hw/ac97.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index d71072d..a946c1a 100644 --- a/hw/ac97.c +++ b/hw/ac97.c @@ -1001,8 +1001,6 @@ static int write_audio (AC97LinkState *s, AC97BusMasterRegs *r, static void write_bup (AC97LinkState *s, int elapsed) { - int written = 0; - dolog ("write_bup\n"); if (!(s->bup_flag & BUP_SET)) { if (s->bup_flag & BUP_LAST) { @@ -1026,7 +1024,6 @@ static void write_bup (AC97LinkState *s, int elapsed) return; temp -= copied; elapsed -= copied; - written += copied; } } } @@ -1069,7 +1066,7 @@ static int read_audio (AC97LinkState *s, AC97BusMasterRegs *r, static void transfer_audio (AC97LinkState *s, int index, int elapsed) { AC97BusMasterRegs *r = &s->bm_regs[index]; - int written = 0, stop = 0; + int stop = 0; if (s->invalid_freq[index]) { AUD_log ("ac97", "attempt to use voice %d with invalid frequency %d\n", @@ -1114,7 +1111,6 @@ static void transfer_audio (AC97LinkState *s, int index, int elapsed) switch (index) { case PO_INDEX: temp = write_audio (s, r, elapsed, &stop); - written += temp; elapsed -= temp; r->picb -= (temp >> 1); break;