[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen: netback: fix error printf format string.



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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.