qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 15/16] pci-host: Convert conditional compilat


From: Marc Marí
Subject: Re: [Qemu-devel] [PATCH v2 15/16] pci-host: Convert conditional compilation of debug printfs to regular ifs
Date: Tue, 13 May 2014 11:13:27 +0200

El Tue, 13 May 2014 09:02:51 +0200
Marc Marí <address@hidden> escribió:
> diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
> index c80b7cb..dfeb19e 100644
> --- a/hw/pci-host/ppce500.c
> +++ b/hw/pci-host/ppce500.c
> @@ -21,12 +21,16 @@
>  #include "qemu/bswap.h"
>  #include "hw/pci-host/ppce500.h"
>  
> +//#define DEBUG_PCI
> +
>  #ifdef DEBUG_PCI
> -#define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
> +#define DEBUG_PCI_ENABLED 1
>  #else
> -#define pci_debug(fmt, ...)
> +#define DEBUG_PCI_ENABLED 0
>  #endif
>  
> +#define pci_debug(fmt, ...) QEMU_DPRINTF(DEBUG_PCI_ENABLED,
> "ppce500", fmt, ## __VA_ARGS__) +
>  #define PCIE500_CFGADDR       0x0
>  #define PCIE500_CFGDATA       0x4
>  #define PCIE500_REG_BASE      0xC00

In this file, the function name is already written to the macro, so now
it will appear two times. The calls to the macro can be changed to not
add the function name, which, in my opinion, is a bit nicer.

Marc



reply via email to

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