qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 00/57] target-i386 eflags cleanup and bmi/adx ex


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 00/57] target-i386 eflags cleanup and bmi/adx extensions
Date: Fri, 25 Jan 2013 11:46:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 01/25/2013 11:40 AM, Richard Henderson wrote:
> On 2013-01-25 10:16, Eric Blake wrote:
>>> >Which is exactly the case for all three errors reported in this series.
>>> >I know of no other good way to arrange this pattern.
>> #ifdef SOMETHING
>> # define SOMETHING_WITNESS 1
>> #else
>> # define SOMETHING_WITNESS 0
>> #endif
>>
>> if (foo && SOMETHING_WITNESS) {
>>      bar();
>> } else {
>>      baz1();
>>      baz2();
>> }
>>
>> That is, hoist your #ifdeffery earlier into the file, and then you can
>> avoid #ifdefs inside the function body, and thus avoid the checkpatch
>> complaints; plus you get the benefit of testing that the code for
>> SOMETHING compiles cleanly even when SOMETHING is not defined.
> 
> Well, in this case bar is not present when SOMETHING is undefined, which
> means that it definitely won't compile.

Even that can be fixed:

#ifdef SOMETHING
# define SOMETHING_WITNESS 1
#else
# define SOMETHING_WITNESS 0
# define bar() ((void) 0)
#endif

> 
> Fixing that is a significant amount of work inside tcg/tcg-op.h against
> which this patch series should not be held up against.

True, which is why I will leave it up to the maintainers whether to take
your patch in spite of the checkpatch complaints.  I was merely pointing
out that a cleanup is possible, not that it is mandatory for acceptance.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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