From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avy6U-0000nK-S9 for qemu-devel@nongnu.org; Thu, 28 Apr 2016 22:24:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avy6T-0005mO-T0 for qemu-devel@nongnu.org; Thu, 28 Apr 2016 22:24:26 -0400 References: <1461894245-22798-1-git-send-email-zhoujie2011@cn.fujitsu.com> From: Eric Blake Message-ID: <5722C5D2.1080609@redhat.com> Date: Thu, 28 Apr 2016 20:24:18 -0600 MIME-Version: 1.0 In-Reply-To: <1461894245-22798-1-git-send-email-zhoujie2011@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5LpbcW38Dalf5CADIvg4vgqjCaOl583Ul" Subject: Re: [Qemu-devel] [PATCH v2] block: always compile-check debug prints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhou Jie , qemu-devel@nongnu.org Cc: jcody@redhat.com, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5LpbcW38Dalf5CADIvg4vgqjCaOl583Ul Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/28/2016 07:44 PM, Zhou Jie wrote: > Files with conditional debug statements should ensure that the printf i= s > always compiled. > This prevents bitrot of the format string of the debug statement. The commit message needs to mention... >=20 > Signed-off-by: Zhou Jie > --- Right here would be a good place to list how v2 differs from v1. > block/curl.c | 10 ++++++++-- > block/sheepdog.c | 13 ++++++++----- > 2 files changed, 16 insertions(+), 7 deletions(-) >=20 > diff --git a/block/curl.c b/block/curl.c > index 5a8f8b6..da9f5e8 100644 > --- a/block/curl.c > +++ b/block/curl.c > @@ -36,10 +36,16 @@ > // #define DEBUG_VERBOSE > =20 > #ifdef DEBUG_CURL > -#define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0= ) > +#define DEBUG_CURL_PRINT 1 > #else > -#define DPRINTF(fmt, ...) do { } while (0) > +#define DEBUG_CURL_PRINT 0 > #endif > +#define DPRINTF(fmt, ...) \= > + do { \= > + if (DEBUG_CURL_PRINT) { \= > + fprintf(stderr, fmt, ## __VA_ARGS__); \= =2E..that you are intentionally switching debug output to stderr. The code changes themselves look fine to me now, so with a better commit message, you could add: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --5LpbcW38Dalf5CADIvg4vgqjCaOl583Ul Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXIsXSAAoJEKeha0olJ0NqA/MH/RIAH8yIuqKSvQM2rBTCz5Xt Tbf8lBnz2Pal4M655TKov5cyxHsDT0AkVp8JR2YXGURQrPpxKTY2Cd27UlXKlvrD 5J/Bh+lDg9NIeC4Oodor7ZmTxiZm7Lu1WN5bd83N58UjgkLi4+hdecXFG3/HfRT6 JBqmHjS+d00O1XzaTMZNE41zNvRa2N+QjTVl/AomOi5a/vDt0TI8rYpVJqt7SqwT wQNZXp1hZ3rJPfMXs9RZKuyBV9YC2Cu88SaojOmAx310sJFABOkNy9Du9wTcPGc3 4nm2iIjcx9DAV1thsNMPjr+GFRhcE/H/4YLX2kPsC4x67iTKZ+XReOArwJu/7+M= =L7fr -----END PGP SIGNATURE----- --5LpbcW38Dalf5CADIvg4vgqjCaOl583Ul--