qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH] fdc: always compile-check debug prints


From: John Snow
Subject: Re: [Qemu-block] [PATCH] fdc: always compile-check debug prints
Date: Mon, 8 Feb 2016 18:16:37 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0


On 02/08/2016 06:11 PM, Eric Blake wrote:
> On 02/08/2016 03:45 PM, John Snow wrote:
>> Coverity noticed that some variables are only used by debug prints, and
>> called them unused. Always compile the print statements.
>>
>> Bonus: Fix a printf I broke.
> 
> Might be nice to mention the commit that broke it.
> 

Sure.

>>
>> Signed-off-by: John Snow <address@hidden>
>> ---
>>  hw/block/fdc.c | 15 ++++++++-------
>>  1 file changed, 8 insertions(+), 7 deletions(-)
>>
> 
>>  #define FLOPPY_DPRINTF(fmt, ...)                                \
>> -    do { printf("FLOPPY: " fmt , ## __VA_ARGS__); } while (0)
>> -#else
>> -#define FLOPPY_DPRINTF(fmt, ...)
>> -#endif
>> +    do {                                                        \
>> +        if (DEBUG_FLOPPY) {                                     \
>> +            fprintf(stderr, "FLOPPY: " fmt , ## __VA_ARGS__);   \
> 
> The switch from stdout to stderr doesn't hurt, either, if you want to
> mention it in the commit as intentional.
> 

Sure 2x combo

> Reviewed-by: Eric Blake <address@hidden>
> 

Thanks!



reply via email to

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