qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 04/11] lsi53c895a: avoid a write only variable
Date: Wed, 6 Oct 2010 21:32:46 +0000	[thread overview]
Message-ID: <AANLkTimu7PP5qjZNUuzcTHxwEDOW081jnLFZPJQw-jR+@mail.gmail.com> (raw)

Compiling with GCC 4.6.0 20100925 produced a warning:
/src/qemu/hw/lsi53c895a.c: In function 'lsi_do_msgout':
/src/qemu/hw/lsi53c895a.c:848:9: error: variable 'len' set but not
used [-Werror=unused-but-set-variable]

Fix by making the variable declaration and its uses also conditional
to debug definition.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/lsi53c895a.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 5eaf69e..db28f06 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -845,8 +845,9 @@ static uint8_t lsi_get_msgbyte(LSIState *s)
 static void lsi_do_msgout(LSIState *s)
 {
     uint8_t msg;
+#ifdef DEBUG_LSI
     int len;
-
+#endif
     DPRINTF("MSG out len=%d\n", s->dbc);
     while (s->dbc) {
         msg = lsi_get_msgbyte(s);
@@ -862,7 +863,11 @@ static void lsi_do_msgout(LSIState *s)
             lsi_set_phase(s, PHASE_CMD);
             break;
         case 0x01:
+#ifdef DEBUG_LSI
             len = lsi_get_msgbyte(s);
+#else
+            (void)lsi_get_msgbyte(s);
+#endif
             msg = lsi_get_msgbyte(s);
             DPRINTF("Extended message 0x%x (len %d)\n", msg, len);
             switch (msg) {
-- 
1.6.2.4

             reply	other threads:[~2010-10-06 21:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06 21:32 Blue Swirl [this message]
2010-10-07  7:20 ` [Qemu-devel] Re: [PATCH 04/11] lsi53c895a: avoid a write only variable Paolo Bonzini
2010-10-07  9:20   ` Markus Armbruster
2010-10-07 18:53     ` Blue Swirl
2010-10-08 16:11       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimu7PP5qjZNUuzcTHxwEDOW081jnLFZPJQw-jR+@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).