All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ac97: Remove unused local variables
@ 2011-05-08  6:58 Stefan Weil
  2011-05-08 12:03 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2011-05-08  6:58 UTC (permalink / raw)
  To: QEMU Developers; +Cc: qemu-trivial

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 <weil@mail.berlios.de>
---
 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;
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] ac97: Remove unused local variables
  2011-05-08  6:58 [Qemu-devel] [PATCH] ac97: Remove unused local variables Stefan Weil
@ 2011-05-08 12:03 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2011-05-08 12:03 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, QEMU Developers

On Sun, May 08, 2011 at 08:58:11AM +0200, Stefan Weil wrote:
> 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 <weil@mail.berlios.de>
> ---
>  hw/ac97.c |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)

Thanks, applied to the trivial-patches branch:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

For more information see http://wiki.qemu.org/Contribute/TrivialPatches.

Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-08 12:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-08  6:58 [Qemu-devel] [PATCH] ac97: Remove unused local variables Stefan Weil
2011-05-08 12:03 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.