qemu-devel
[Top][All Lists]
Advanced

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

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


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] fdc: always compile-check debug prints
Date: Mon, 8 Feb 2016 16:11:04 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

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.

> 
> 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.

Reviewed-by: Eric Blake <address@hidden>

-- 
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]