From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jes.Sorensen@redhat.com
Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] vhost_net.c: v2 Fix build failure introduced by 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2
Date: Thu, 27 May 2010 13:44:14 +0300 [thread overview]
Message-ID: <20100527104414.GA7250@redhat.com> (raw)
In-Reply-To: <1274955749-20689-1-git-send-email-Jes.Sorensen@redhat.com>
On Thu, May 27, 2010 at 12:22:29PM +0200, Jes.Sorensen@redhat.com wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> Fix build failure introduced by 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2
>
> The format statement expects unsigned long on x86_64, but receives
> unsigned long long, so gcc exits with an error.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
I think this part of 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2
should just be reverted. We have unsigned long, it should be printed
woith %ll. Casting to uint64_t just so we can print with PRIu64 seems silly.
> ---
> hw/vhost_net.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/vhost_net.c b/hw/vhost_net.c
> index 26dae79..606aa0c 100644
> --- a/hw/vhost_net.c
> +++ b/hw/vhost_net.c
> @@ -100,7 +100,7 @@ struct vhost_net *vhost_net_init(VLANClientState *backend, int devfd)
> }
> if (~net->dev.features & net->dev.backend_features) {
> fprintf(stderr, "vhost lacks feature mask %" PRIu64 " for backend\n",
> - ~net->dev.features & net->dev.backend_features);
> + (uint64_t)(~net->dev.features & net->dev.backend_features));
> vhost_dev_cleanup(&net->dev);
> goto fail;
> }
How about just (untested):
vhost: fix build broken by 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2
revert over-zealous PRIu64 conversion from
0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
Does this help?
diff --git a/hw/vhost_net.c b/hw/vhost_net.c
index 26dae79..2e292ee 100644
--- a/hw/vhost_net.c
+++ b/hw/vhost_net.c
@@ -99,7 +99,7 @@ struct vhost_net *vhost_net_init(VLANClientState *backend, int devfd)
goto fail;
}
if (~net->dev.features & net->dev.backend_features) {
- fprintf(stderr, "vhost lacks feature mask %" PRIu64 " for backend\n",
+ fprintf(stderr, "vhost lacks feature mask %llu for backend\n",
~net->dev.features & net->dev.backend_features);
vhost_dev_cleanup(&net->dev);
goto fail;
next prev parent reply other threads:[~2010-05-27 10:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 10:22 [Qemu-devel] [PATCH] vhost_net.c: v2 Fix build failure introduced by 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2 Jes.Sorensen
2010-05-27 10:44 ` Michael S. Tsirkin [this message]
2010-05-27 10:55 ` [Qemu-devel] " Jes Sorensen
2010-05-27 10:53 ` Michael S. Tsirkin
2010-05-27 10:59 ` Jes Sorensen
2010-05-27 10:54 ` Michael S. Tsirkin
2010-05-27 11:04 ` Jes Sorensen
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=20100527104414.GA7250@redhat.com \
--to=mst@redhat.com \
--cc=Jes.Sorensen@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/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).