From: Jason Wang <jasowang@redhat.com>
To: Eric Blake <eblake@redhat.com>, Miao Yan <yanmiaobest@gmail.com>,
dmitry@daynix.com, qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 2/3] net/vmxnet3: fix debug macro pattern for vmxnet3
Date: Fri, 11 Dec 2015 11:12:57 +0800 [thread overview]
Message-ID: <566A3F39.60103@redhat.com> (raw)
In-Reply-To: <5666028A.5000402@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 <yanmiaobest@gmail.com>
>>> Reviewed-by: Eric Blake <eblake@redhat.com>
>>> ---
>>> 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
next prev parent reply other threads:[~2015-12-11 3:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-05 8:54 [Qemu-devel] [PATCH v2 0/3] fix debug macro pattern for vmxnet3 Miao Yan
2015-12-05 8:55 ` [Qemu-devel] [PATCH v2 1/3] net/vmxnet3.c: fix a build error when enabling debug output Miao Yan
2015-12-05 16:32 ` Eric Blake
2015-12-05 8:55 ` [Qemu-devel] [PATCH v2 2/3] net/vmxnet3: fix debug macro pattern for vmxnet3 Miao Yan
2015-12-07 2:47 ` Jason Wang
2015-12-07 22:04 ` Eric Blake
2015-12-08 2:53 ` Miao Yan
2015-12-11 3:12 ` Jason Wang [this message]
2015-12-05 8:55 ` [Qemu-devel] [PATCH v2 3/3] net/vmxnet3: remove redundant VMW_SHPRN(...) definition Miao Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=566A3F39.60103@redhat.com \
--to=jasowang@redhat.com \
--cc=armbru@redhat.com \
--cc=dmitry@daynix.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yanmiaobest@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).