From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [Qemu-devel] [PATCH v2 02/16] s390: Convert conditional compilation of debug printfs to regular ifs Date: Tue, 13 May 2014 11:04:32 +0200 Message-ID: <20140513110432.32b3f86d.cornelia.huck@de.ibm.com> References: <1399964572-5376-1-git-send-email-marc.mari.barcelo@gmail.com> <1399964572-5376-3-git-send-email-marc.mari.barcelo@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Peter Crosthwaite , Andreas =?UTF-8?B?RsOkcmJl?= =?UTF-8?B?cg==?= , "open list:Overall" To: Marc =?UTF-8?B?TWFyw60=?= Return-path: Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:52764 "EHLO e06smtp18.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759796AbaEMJEw convert rfc822-to-8bit (ORCPT ); Tue, 13 May 2014 05:04:52 -0400 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 May 2014 10:04:37 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 565D01B08040 for ; Tue, 13 May 2014 10:04:48 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4D94Yrx4325852 for ; Tue, 13 May 2014 09:04:34 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4D94XB3013689 for ; Tue, 13 May 2014 03:04:34 -0600 In-Reply-To: <1399964572-5376-3-git-send-email-marc.mari.barcelo@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 13 May 2014 09:02:38 +0200 Marc Mar=C3=AD wrote: I'd replace the subject with "s390: convert debug printfs to QEMU_DPRINTF" which is more descriptive and has the additional virtue of being shorter ;) > 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/s390x/s390-virtio-bus.c | 8 ++++---- > hw/s390x/s390-virtio.c | 8 ++++---- > target-s390x/helper.c | 22 ++++++++++++++-------- > target-s390x/kvm.c | 8 ++++---- > 4 files changed, 26 insertions(+), 20 deletions(-) >=20 > diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c > index 9c71afa..c3a6302 100644 > --- a/hw/s390x/s390-virtio-bus.c > +++ b/hw/s390x/s390-virtio-bus.c > @@ -38,13 +38,13 @@ > /* #define DEBUG_S390 */ >=20 > #ifdef DEBUG_S390 > -#define DPRINTF(fmt, ...) \ > - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) > +#define DEBUG_S390_ENABLED 1 > #else > -#define DPRINTF(fmt, ...) \ > - do { } while (0) > +#define DEBUG_S390_ENABLED 0 > #endif >=20 > +#define DPRINTF(fmt, ...) QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 vir= tio bus", fmt, ## __VA_ARGS__) I think this line is a bit too long. > + > #define VIRTIO_EXT_CODE 0x2603 >=20 > static void virtio_s390_bus_new(VirtioBusState *bus, size_t bus_size= , > diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c > index aef2003..133c320 100644 > --- a/hw/s390x/s390-virtio.c > +++ b/hw/s390x/s390-virtio.c > @@ -42,13 +42,13 @@ > //#define DEBUG_S390 >=20 > #ifdef DEBUG_S390 > -#define DPRINTF(fmt, ...) \ > - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) > +#define DEBUG_S390_ENABLED 1 > #else > -#define DPRINTF(fmt, ...) \ > - do { } while (0) > +#define DEBUG_S390_ENABLED 0 > #endif >=20 > +#define DPRINTF(fmt, ...) QEMU_DPRINTF(DEBUG_S390_ENABLED, "s390 vir= tio", fmt, ## __VA_ARGS__) dito > + > #define MAX_BLK_DEVS 10 > #define ZIPL_FILENAME "s390-zipl.rom" >=20 > diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c > index b7b0edc..5aad3c9 100644 > --- a/target-s390x/kvm.c > +++ b/target-s390x/kvm.c > @@ -41,13 +41,13 @@ > /* #define DEBUG_KVM */ >=20 > #ifdef DEBUG_KVM > -#define DPRINTF(fmt, ...) \ > - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) > +#define DEBUG_KVM_ENABLED 1 > #else > -#define DPRINTF(fmt, ...) \ > - do { } while (0) > +#define DEBUG_KVM_ENABLED 0 > #endif >=20 > +#define DPRINTF(fmt, ...) QEMU_DPRINTF(DEBUG_KVM_ENABLED, "s390 kvm"= , fmt, ## __VA_ARGS__) dito :) > + > #define IPA0_DIAG 0x8300 > #define IPA0_SIGP 0xae00 > #define IPA0_B2 0xb200