From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk8tI-0003fJ-Ku for qemu-devel@nongnu.org; Tue, 13 May 2014 05:21:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wk8t9-0003AW-J6 for qemu-devel@nongnu.org; Tue, 13 May 2014 05:20:52 -0400 Received: from mail-we0-x234.google.com ([2a00:1450:400c:c03::234]:62469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk8t9-0003AR-Cj for qemu-devel@nongnu.org; Tue, 13 May 2014 05:20:43 -0400 Received: by mail-we0-f180.google.com with SMTP id t61so66678wes.39 for ; Tue, 13 May 2014 02:20:42 -0700 (PDT) Date: Tue, 13 May 2014 11:20:39 +0200 From: Marc =?UTF-8?B?TWFyw60=?= Message-ID: <20140513112039.424cf4e2@crunchbang> In-Reply-To: <1399964572-5376-10-git-send-email-marc.mari.barcelo@gmail.com> References: <1399964572-5376-1-git-send-email-marc.mari.barcelo@gmail.com> <1399964572-5376-10-git-send-email-marc.mari.barcelo@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 09/16] i82374: Convert conditional compilation of debug printfs to regular ifs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marc =?UTF-8?B?TWFyw60=?= Cc: Stefan Hajnoczi , Peter Crosthwaite , qemu-devel@nongnu.org, Andreas =?UTF-8?B?RsOkcmJlcg==?= El Tue, 13 May 2014 09:02:45 +0200 Marc Mar=C3=AD escribi=C3=B3: > hw/dma/i82374.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) >=20 > diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c > index b8ad2e6..7026f24 100644 > --- a/hw/dma/i82374.c > +++ b/hw/dma/i82374.c > @@ -27,14 +27,13 @@ > //#define DEBUG_I82374 > =20 > #ifdef DEBUG_I82374 > -#define DPRINTF(fmt, ...) \ > -do { fprintf(stderr, "i82374: " fmt , ## __VA_ARGS__); } while (0) > +#define DEBUG_I82374_ENABLED 1 > #else > -#define DPRINTF(fmt, ...) \ > -do {} while (0) > +#define DEBUG_I82374_ENABLED 0 > #endif > -#define BADF(fmt, ...) \ > -do { fprintf(stderr, "i82374 ERROR: " fmt , ## __VA_ARGS__); } while > (0) + > +#define DPRINTF(fmt, ...) QEMU_DPRINTF(DEBUG_I82374_ENABLED, > "i82374", fmt, ## __VA_ARGS__) +#define BADF(fmt, ...) > QEMU_DPRINTF(1, "i82374 ERROR", fmt, ## __VA_ARGS__)=20 > typedef struct I82374State { > uint8_t commands[8]; In this file, the function name is already written when the macros are called, 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