qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 01/15] openpic: fix debug prints


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 01/15] openpic: fix debug prints
Date: Thu, 3 Jan 2013 18:31:49 +0100

On 22.12.2012, at 03:15, Scott Wood wrote:

> Fix various format errors when debug prints are enabled.  Also
> cause error checking to happen even when debug prints are not
> enabled, and consistently use 0x for hex output.
> 
> Signed-off-by: Scott Wood <address@hidden>
> ---
> hw/openpic.c |   40 ++++++++++++++++++++++++----------------
> 1 file changed, 24 insertions(+), 16 deletions(-)
> 
> diff --git a/hw/openpic.c b/hw/openpic.c
> index 93e8208..72a5bc9 100644
> --- a/hw/openpic.c
> +++ b/hw/openpic.c
> @@ -45,7 +45,11 @@
> #ifdef DEBUG_OPENPIC

static const int debug_openpic = 1;
#else
static const int debug_openpic = 0;

> #define DPRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0)
> #else
> -#define DPRINTF(fmt, ...) do { } while (0)
> +#define DPRINTF(fmt, ...) do { \
> +        if (0) { \

if (debug_openpic)

> +            printf(fmt , ## __VA_ARGS__); \
> +        } \
> +    } while (0)
> #endif

That way we don't need to duplicate the print define. Let me fix that up for 
you while applying the patch.


Alex




reply via email to

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