From patchwork Sun May 8 16:05:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 94570 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 5EDCEB7149 for ; Mon, 9 May 2011 02:06:41 +1000 (EST) Received: from localhost ([::1]:56190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ6VC-0006Sr-BI for incoming@patchwork.ozlabs.org; Sun, 08 May 2011 12:06:38 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ6Ug-0006N5-ID for qemu-devel@nongnu.org; Sun, 08 May 2011 12:06:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJ6Ue-0007Xx-VS for qemu-devel@nongnu.org; Sun, 08 May 2011 12:06:06 -0400 Received: from mtagate1.uk.ibm.com ([194.196.100.161]:38452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ6Ue-0007XN-JQ for qemu-devel@nongnu.org; Sun, 08 May 2011 12:06:04 -0400 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p48G6330023804 for ; Sun, 8 May 2011 16:06:03 GMT Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p48G7JBn2207864 for ; Sun, 8 May 2011 17:07:19 +0100 Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p48G63ab021773 for ; Sun, 8 May 2011 10:06:03 -0600 Received: from stefanha-thinkpad.ibm.com (sig-9-146-157-45.uk.ibm.com [9.146.157.45]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p48G5njl021096; Sun, 8 May 2011 10:06:03 -0600 From: Stefan Hajnoczi To: Anthony Liguori Date: Sun, 8 May 2011 17:05:15 +0100 Message-Id: <1304870719-20885-21-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1304870719-20885-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1304870719-20885-1-git-send-email-stefanha@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 194.196.100.161 Cc: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 20/24] 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 From: Stefan Weil 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 Signed-off-by: Stefan Hajnoczi --- 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;