From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk8dx-0004YY-RI for qemu-devel@nongnu.org; Tue, 13 May 2014 05:05:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wk8do-0005va-OX for qemu-devel@nongnu.org; Tue, 13 May 2014 05:05:01 -0400 Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:56892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk8do-0005vF-G5 for qemu-devel@nongnu.org; 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:36 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id D8A311B0807F for ; Tue, 13 May 2014 10:04:47 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4D94X8h983420 for ; Tue, 13 May 2014 09:04:33 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 s4D94XAx013689 for ; Tue, 13 May 2014 03:04:33 -0600 Date: Tue, 13 May 2014 11:04:32 +0200 From: Cornelia Huck Message-ID: <20140513110432.32b3f86d.cornelia.huck@de.ibm.com> In-Reply-To: <1399964572-5376-3-git-send-email-marc.mari.barcelo@gmail.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 Subject: Re: [Qemu-devel] [PATCH v2 02/16] s390: 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, "open list:Overall" , Andreas =?UTF-8?B?RsOkcmJl?= =?UTF-8?B?cg==?= 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 added t= o 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 virtio = 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 virtio"= , 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", fm= t, ## __VA_ARGS__) dito :) > + > #define IPA0_DIAG 0x8300 > #define IPA0_SIGP 0xae00 > #define IPA0_B2 0xb200