From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk8f7-00067j-Av for qemu-devel@nongnu.org; Tue, 13 May 2014 05:06:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wk8ey-0006iE-0m for qemu-devel@nongnu.org; Tue, 13 May 2014 05:06:13 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:34681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk8ex-0006i4-O9 for qemu-devel@nongnu.org; Tue, 13 May 2014 05:06:03 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 May 2014 10:06:02 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id E89802190063 for ; Tue, 13 May 2014 10:05:52 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4D961FU43122738 for ; Tue, 13 May 2014 09:06:01 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4D961cJ009710 for ; Tue, 13 May 2014 03:06:01 -0600 Date: Tue, 13 May 2014 11:05:59 +0200 From: Cornelia Huck Message-ID: <20140513110559.3c611f26.cornelia.huck@de.ibm.com> In-Reply-To: <1399964572-5376-17-git-send-email-marc.mari.barcelo@gmail.com> References: <1399964572-5376-1-git-send-email-marc.mari.barcelo@gmail.com> <1399964572-5376-17-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 16/16] common: 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?RsOkcmJl?= =?UTF-8?B?cg==?= On Tue, 13 May 2014 09:02:52 +0200 Marc Mar=C3=AD wrote: > 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 > --- > include/qemu-common.h | 7 +++++++ > migration-rdma.c | 32 ++++++++++++++------------------ > page_cache.c | 10 ++++++---- > 3 files changed, 27 insertions(+), 22 deletions(-) >=20 > diff --git a/include/qemu-common.h b/include/qemu-common.h > index 3f3fd60..3593bdc 100644 > --- a/include/qemu-common.h > +++ b/include/qemu-common.h > @@ -463,3 +463,10 @@ int parse_debug_env(const char *name, int max, int i= nitial); > const char *qemu_ether_ntoa(const MACAddr *mac); >=20 > #endif > + > +#define QEMU_DPRINTF(cond,pfx,fmt,...) \ > + do { \ > + if (cond) { \ > + fprintf(stderr, pfx": %s:"fmt, __func__, ## __VA_ARGS__); \ > + } \ > + } while (0) I'd split that hunk into a seperate patch and make it the first one in the series. That way, you'd preserve bisectability.