From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSuxZ-0008HV-1e for qemu-devel@nongnu.org; Mon, 08 Feb 2016 18:11:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSuxY-0002sV-0c for qemu-devel@nongnu.org; Mon, 08 Feb 2016 18:11:08 -0500 References: <1454971529-14830-1-git-send-email-jsnow@redhat.com> From: Eric Blake Message-ID: <56B92088.6050807@redhat.com> Date: Mon, 8 Feb 2016 16:11:04 -0700 MIME-Version: 1.0 In-Reply-To: <1454971529-14830-1-git-send-email-jsnow@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KIPIsGQFhIWxPEDSiSjtKS2Fhq9d2a4U8" Subject: Re: [Qemu-devel] [PATCH] fdc: always compile-check debug prints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KIPIsGQFhIWxPEDSiSjtKS2Fhq9d2a4U8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/08/2016 03:45 PM, John Snow wrote: > Coverity noticed that some variables are only used by debug prints, and= > called them unused. Always compile the print statements. >=20 > Bonus: Fix a printf I broke. Might be nice to mention the commit that broke it. >=20 > Signed-off-by: John Snow > --- > hw/block/fdc.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) >=20 > #define FLOPPY_DPRINTF(fmt, ...) \ > - do { printf("FLOPPY: " fmt , ## __VA_ARGS__); } while (0) > -#else > -#define FLOPPY_DPRINTF(fmt, ...) > -#endif > + do { \ > + if (DEBUG_FLOPPY) { \ > + fprintf(stderr, "FLOPPY: " fmt , ## __VA_ARGS__); \ The switch from stdout to stderr doesn't hurt, either, if you want to mention it in the commit as intentional. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KIPIsGQFhIWxPEDSiSjtKS2Fhq9d2a4U8 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/ iQEcBAEBCAAGBQJWuSCIAAoJEKeha0olJ0NqRbUH/2W/nlAlbl92w9ULpldTkzGC 0gYQtuKy3bMYTxsAHvZIe5NFl/GH3AcG1YcT4FjsPap7ccKIHUZTMlWmBpC1Lq+6 YipZygMpV8YasI7gqIeSDmkBU0BJe4tf6/yXPt6A0AaPn0Etnu9+QVPXtncZ4XKN pBNOiG4UsVgqeNdqI8IwagAu14rZ6Tvv8+2AQsdYUBmqtwGMPkmio4xR7i97R3Au cpYe2NCQlDhFZtjreeYmVzftcCZFcOV5ef7xc4tGVKAbXU+84IBa7tbKQvGmKaFR OmeyN/6LivxeSIs8jlUhgij0/VTmeEpMpfBx2hkvDkv5+9YJsPxDTSN9anbBtrY= =0lWK -----END PGP SIGNATURE----- --KIPIsGQFhIWxPEDSiSjtKS2Fhq9d2a4U8--