From: Ian Campbell <ian.campbell@citrix.com>
To: David Miller <davem@davemloft.net>
Cc: <xen-devel@lists.xen.org>, <netdev@vger.kernel.org>,
<wei.liu2@citrix.com>
Subject: Re: [PATCH] xen: netback: fix error printf format string.
Date: Mon, 1 Jun 2015 09:29:16 +0100 [thread overview]
Message-ID: <1433147356.15036.74.camel@citrix.com> (raw)
In-Reply-To: <20150531.212618.1162284397803953903.davem@davemloft.net>
On Sun, 2015-05-31 at 21:26 -0700, David Miller wrote:
> From: Ian Campbell <ian.campbell@citrix.com>
> Date: Fri, 29 May 2015 17:22:04 +0100
>
> > drivers/net/xen-netback/netback.c: In function ‘xenvif_tx_build_gops’:
> > drivers/net/xen-netback/netback.c:1253:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘int’ [-Wformat=]
> > (txreq.offset&~PAGE_MASK) + txreq.size);
> > ^
> >
> > txreq.offset and .size are uint16_t fields.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>
> This may get rid of the compiler warning on your machine, but it creates
> one on mine:
>
> drivers/net/xen-netback/netback.c: In function ‘xenvif_tx_build_gops’:
> drivers/net/xen-netback/netback.c:1253:8: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
> (txreq.offset&~PAGE_MASK) + txreq.size);
> ^
>
> There is a type involved in this calculation which is arch
> dependent, so you'll need to add a cast or something to
> make this warning go away in all cases.
Ah, I only considered the types txreq.{offset,size} and missed thinking
about PAGE_MASK.
I'll resend with a cast.
Ian.
next prev parent reply other threads:[~2015-06-01 8:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 16:22 [PATCH] xen: netback: fix error printf format string Ian Campbell
2015-05-29 16:24 ` Wei Liu
2015-05-29 16:24 ` Wei Liu
2015-06-01 4:26 ` David Miller
2015-06-01 8:29 ` Ian Campbell
2015-06-01 8:29 ` Ian Campbell [this message]
2015-06-01 4:26 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2015-05-29 16:22 Ian Campbell
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=1433147356.15036.74.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.