From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Subject: Re: [PATCH v2 01/16] x86: Convert conditional compilation of debug printfs to regular ifs Date: Tue, 13 May 2014 09:38:35 +0200 Message-ID: <5371CBFB.4030609@suse.de> References: <1399964572-5376-1-git-send-email-marc.mari.barcelo@gmail.com> <1399964572-5376-2-git-send-email-marc.mari.barcelo@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1399964572-5376-2-git-send-email-marc.mari.barcelo@gmail.com> Sender: kvm-owner@vger.kernel.org To: =?UTF-8?B?TWFyYyBNYXLDrQ==?= , qemu-devel@nongnu.org Cc: Peter Crosthwaite , Stefan Hajnoczi , kvm , xen-devel List-Id: xen-devel@lists.xenproject.org Am 13.05.2014 09:02, schrieb Marc Mar=C3=AD: > Modify debug macros to have the same format through the codebase and = use regular > ifs instead of ifdef. >=20 > As the debug printf is always put in code, some casting had to be add= ed to avoid > warnings treated as errors at compile time. >=20 > Signed-off-by: Marc Mar=C3=AD > --- > hw/i386/kvm/pci-assign.c | 9 ++++----- > hw/i386/multiboot.c | 6 ++++-- > target-i386/kvm.c | 8 ++++---- > xen-hvm.c | 12 ++++++------ > xen-mapcache.c | 8 ++++---- > 5 files changed, 22 insertions(+), 21 deletions(-) >=20 > diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c > index e55421a..35757ae 100644 > --- a/hw/i386/kvm/pci-assign.c > +++ b/hw/i386/kvm/pci-assign.c > @@ -51,14 +51,13 @@ > //#define DEVICE_ASSIGNMENT_DEBUG > =20 > #ifdef DEVICE_ASSIGNMENT_DEBUG > -#define DEBUG(fmt, ...) \ > - do { \ > - fprintf(stderr, "%s: " fmt, __func__ , __VA_ARGS__); \ > - } while (0) > +#define DEVICE_ASSIGNMENT_DEBUG_ENABLED 1 > #else > -#define DEBUG(fmt, ...) > +#define DEVICE_ASSIGNMENT_DEBUG_ENABLED 0 > #endif > =20 > +#define DEBUG(fmt, ...) QEMU_DPRINTF(DEVICE_ASSIGNMENT_DEBUG_ENABLED= , "pci_assign", fmt, ## __VA_ARGS__) This is broken, QEMU_DPRINTF() is not defined yet. Looks like an ordering issue with 16/16. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3= =BCrnberg