|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen: netback: fix error printf format string.
On Sun, 2015-05-31 at 21:26 -0700, David Miller wrote:
> From: Ian Campbell <ian.campbell@xxxxxxxxxx>
> 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@xxxxxxxxxx>
>
> 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.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |