public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
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.

      reply	other threads:[~2015-06-01  8:29 UTC|newest]

Thread overview: 4+ 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-06-01  4:26 ` David Miller
2015-06-01  8:29   ` Ian Campbell [this message]

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$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=wei.liu2@citrix$(echo .)com \
    --cc=xen-devel@lists$(echo .)xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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