All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] fdc: always compile-check debug prints
Date: Mon, 8 Feb 2016 16:11:04 -0700	[thread overview]
Message-ID: <56B92088.6050807@redhat.com> (raw)
In-Reply-To: <1454971529-14830-1-git-send-email-jsnow@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1102 bytes --]

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 <jsnow@redhat.com>
> ---
>  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 <eblake@redhat.com>

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-02-08 23:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 22:45 [Qemu-devel] [PATCH] fdc: always compile-check debug prints John Snow
2016-02-08 23:11 ` Eric Blake [this message]
2016-02-08 23:16   ` John Snow

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=56B92088.6050807@redhat.com \
    --to=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.