From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a63u8-0003H7-Kx for qemu-devel@nongnu.org; Mon, 07 Dec 2015 17:05:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a63u5-0001ii-DM for qemu-devel@nongnu.org; Mon, 07 Dec 2015 17:05:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56977) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a63u5-0001iO-5w for qemu-devel@nongnu.org; Mon, 07 Dec 2015 17:05:05 -0500 References: <1449305702-2122-1-git-send-email-yanmiaobest@gmail.com> <1449305702-2122-3-git-send-email-yanmiaobest@gmail.com> <5664F352.3010305@redhat.com> From: Eric Blake Message-ID: <5666028A.5000402@redhat.com> Date: Mon, 7 Dec 2015 15:04:58 -0700 MIME-Version: 1.0 In-Reply-To: <5664F352.3010305@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VpHWoiwPgmlNIDQot8E9cmLVbw9x4SlEn" Subject: Re: [Qemu-devel] [PATCH v2 2/3] net/vmxnet3: fix debug macro pattern for vmxnet3 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang , Miao Yan , dmitry@daynix.com, qemu-devel@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VpHWoiwPgmlNIDQot8E9cmLVbw9x4SlEn Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/06/2015 07:47 PM, Jason Wang wrote: >=20 >=20 > On 12/05/2015 04:55 PM, Miao Yan wrote: >> Vmxnet3 uses the following debug macro style: >> >> #ifdef SOME_DEBUG >> # define debug(...) do{ printf(...); } while (0) >> # else >> # define debug(...) do{ } while (0) >> #endif >> >> If SOME_DEBUG is undefined, then format string inside the >> debug macro will never be checked by compiler. Code is >> likely to break in the future when SOME_DEBUG is enabled >> because of lack of testing. This patch changes this >> to the following: >> >> #define debug(...) \ >> do { if (SOME_DEBUG_ENABLED) printf(...); } while (0) >> >> Signed-off-by: Miao Yan >> Reviewed-by: Eric Blake >> --- >> Changes in v2: >> - Fix grammar error in commit log >=20 > Applied in my -net for 2.5. Thanks I don't know if Miao saw Peter's reaction to the pull request, but just as I guessed on v1, exposing more format strings turned up more latent bugs in the format strings, with failures such as: > I'm afraid this doesn't build on 32-bit due to format string errors: >=20 > /home/petmay01/qemu/hw/net/vmxnet3.c: In function 'vmxnet3_complete_pac= ket': > /home/petmay01/qemu/hw/net/vmxnet3.c:500:5: error: format '%lu' > expects argument of type 'long unsigned int', but argument 7 has type > 'size_t' [-Werror=3Dformat=3D] > VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring= ); Looks like it will need a v3; and sorry that I didn't catch the problems in my review (I was just going off of whether the macro conversion was correct, and not an actual compile test to see if all the now-live format strings were always valid). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --VpHWoiwPgmlNIDQot8E9cmLVbw9x4SlEn 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/ iQEcBAEBCAAGBQJWZgKKAAoJEKeha0olJ0Nqj0sH/Rw5l7bdF294Ae3ZOMEukHRR doocEgEne4wQIntyPwiTqNHxux3irfom1gI7LAbr8T8UlhOa2X/gAA1tfh3DfaNd HmhUka2fjFlYIBSt36GCDtI1mp9FQjH5CBrcGFRbJ1OHgzLkQ8aRocBjrmOt1o+y xYydNvBcELIC1KkbNKOczzcA3L6/oGCmkkKtYOTg+DSKqEitJaV2Cp9oIubD75dX R2+gjslfd5u32HzYObG8HP3xRN3AmF4Hhxm+656DOyDh/yvRZXFBQt11WnpZjHGy gTU/Z3qV9+AujiMMoCGiYK8HQXGepFOv1C+nvLnMprksG2qSIC/Q44r279pGp6U= =JBlB -----END PGP SIGNATURE----- --VpHWoiwPgmlNIDQot8E9cmLVbw9x4SlEn--