qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH 04/11] lsi53c895a: avoid a write only variab


From: Paolo Bonzini
Subject: Re: [Qemu-devel] Re: [PATCH 04/11] lsi53c895a: avoid a write only variable
Date: Fri, 08 Oct 2010 18:11:11 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.3

On 10/07/2010 08:53 PM, Blue Swirl wrote:
On Thu, Oct 7, 2010 at 9:20 AM, Markus Armbruster<address@hidden>  wrote:
Paolo Bonzini<address@hidden>  writes:

On 10/06/2010 11:32 PM, Blue Swirl wrote:
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.

NACK, this uglifies the code and loses track of _what_ is that msgbyte
we're reading.

That information could be saved by adding a comment, I used that
approach for vmstate.c.

Yes, that's fine for vmstate.c, but here you are also uselessly duplicating the code. (void) len is good though. I suggest doing the same for i386 too (and there you could put a reference to the manual).

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]