From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7E8t-0004w7-JN for qemu-devel@nongnu.org; Thu, 10 Dec 2015 22:13:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7E8p-0006PA-IT for qemu-devel@nongnu.org; Thu, 10 Dec 2015 22:13:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7E8p-0006P6-DX for qemu-devel@nongnu.org; Thu, 10 Dec 2015 22:13:07 -0500 References: <1449305702-2122-1-git-send-email-yanmiaobest@gmail.com> <1449305702-2122-3-git-send-email-yanmiaobest@gmail.com> <5664F352.3010305@redhat.com> <5666028A.5000402@redhat.com> From: Jason Wang Message-ID: <566A3F39.60103@redhat.com> Date: Fri, 11 Dec 2015 11:12:57 +0800 MIME-Version: 1.0 In-Reply-To: <5666028A.5000402@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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: Eric Blake , Miao Yan , dmitry@daynix.com, qemu-devel@nongnu.org, armbru@redhat.com On 12/08/2015 06:04 AM, Eric Blake wrote: > On 12/06/2015 07:47 PM, Jason Wang wrote: >> >> 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 >> 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: >> >> /home/petmay01/qemu/hw/net/vmxnet3.c: In function 'vmxnet3_complete_packet': >> /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=format=] >> 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). > No problem, this also reminds me to do 32-bit compile test before submitting pull request. Thanks