* [PATCH v2] xen: netback: fix printf format string warning
@ 2015-06-01 10:30 Ian Campbell
2015-06-01 11:23 ` Wei Liu
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Ian Campbell @ 2015-06-01 10:30 UTC (permalink / raw)
To: xen-devel, netdev; +Cc: wei.liu2, Ian Campbell
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);
^
PAGE_MASK's type can vary by arch, so a cast is needed.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
----
v2: Cast to unsigned long, since PAGE_MASK can vary by arch.
---
drivers/net/xen-netback/netback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 4de46aa..0d25943 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1250,7 +1250,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
netdev_err(queue->vif->dev,
"txreq.offset: %x, size: %u, end: %lu\n",
txreq.offset, txreq.size,
- (txreq.offset&~PAGE_MASK) + txreq.size);
+ (unsigned long)(txreq.offset&~PAGE_MASK) + txreq.size);
xenvif_fatal_tx_err(queue->vif);
break;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] xen: netback: fix printf format string warning
2015-06-01 10:30 [PATCH v2] xen: netback: fix printf format string warning Ian Campbell
@ 2015-06-01 11:23 ` Wei Liu
2015-06-01 11:23 ` Wei Liu
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2015-06-01 11:23 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel, netdev, wei.liu2
On Mon, Jun 01, 2015 at 11:30:04AM +0100, Ian Campbell wrote:
> 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);
> ^
>
> PAGE_MASK's type can vary by arch, so a cast is needed.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
> ----
> v2: Cast to unsigned long, since PAGE_MASK can vary by arch.
> ---
> drivers/net/xen-netback/netback.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 4de46aa..0d25943 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -1250,7 +1250,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
> netdev_err(queue->vif->dev,
> "txreq.offset: %x, size: %u, end: %lu\n",
> txreq.offset, txreq.size,
> - (txreq.offset&~PAGE_MASK) + txreq.size);
> + (unsigned long)(txreq.offset&~PAGE_MASK) + txreq.size);
> xenvif_fatal_tx_err(queue->vif);
> break;
> }
> --
> 1.7.10.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] xen: netback: fix printf format string warning
2015-06-01 10:30 [PATCH v2] xen: netback: fix printf format string warning Ian Campbell
2015-06-01 11:23 ` Wei Liu
@ 2015-06-01 11:23 ` Wei Liu
2015-06-01 19:03 ` David Miller
2015-06-01 19:03 ` David Miller
3 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2015-06-01 11:23 UTC (permalink / raw)
To: Ian Campbell; +Cc: netdev, wei.liu2, xen-devel
On Mon, Jun 01, 2015 at 11:30:04AM +0100, Ian Campbell wrote:
> 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);
> ^
>
> PAGE_MASK's type can vary by arch, so a cast is needed.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
> ----
> v2: Cast to unsigned long, since PAGE_MASK can vary by arch.
> ---
> drivers/net/xen-netback/netback.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 4de46aa..0d25943 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -1250,7 +1250,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
> netdev_err(queue->vif->dev,
> "txreq.offset: %x, size: %u, end: %lu\n",
> txreq.offset, txreq.size,
> - (txreq.offset&~PAGE_MASK) + txreq.size);
> + (unsigned long)(txreq.offset&~PAGE_MASK) + txreq.size);
> xenvif_fatal_tx_err(queue->vif);
> break;
> }
> --
> 1.7.10.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] xen: netback: fix printf format string warning
2015-06-01 10:30 [PATCH v2] xen: netback: fix printf format string warning Ian Campbell
2015-06-01 11:23 ` Wei Liu
2015-06-01 11:23 ` Wei Liu
@ 2015-06-01 19:03 ` David Miller
2015-06-01 19:03 ` David Miller
3 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2015-06-01 19:03 UTC (permalink / raw)
To: ian.campbell; +Cc: xen-devel, netdev, wei.liu2
From: Ian Campbell <ian.campbell@citrix.com>
Date: Mon, 1 Jun 2015 11:30: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);
> ^
>
> PAGE_MASK's type can vary by arch, so a cast is needed.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ----
> v2: Cast to unsigned long, since PAGE_MASK can vary by arch.
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] xen: netback: fix printf format string warning
2015-06-01 10:30 [PATCH v2] xen: netback: fix printf format string warning Ian Campbell
` (2 preceding siblings ...)
2015-06-01 19:03 ` David Miller
@ 2015-06-01 19:03 ` David Miller
3 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2015-06-01 19:03 UTC (permalink / raw)
To: ian.campbell; +Cc: netdev, wei.liu2, xen-devel
From: Ian Campbell <ian.campbell@citrix.com>
Date: Mon, 1 Jun 2015 11:30: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);
> ^
>
> PAGE_MASK's type can vary by arch, so a cast is needed.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ----
> v2: Cast to unsigned long, since PAGE_MASK can vary by arch.
Applied.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] xen: netback: fix printf format string warning
@ 2015-06-01 10:30 Ian Campbell
0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2015-06-01 10:30 UTC (permalink / raw)
To: xen-devel, netdev; +Cc: wei.liu2, Ian Campbell
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);
^
PAGE_MASK's type can vary by arch, so a cast is needed.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
----
v2: Cast to unsigned long, since PAGE_MASK can vary by arch.
---
drivers/net/xen-netback/netback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 4de46aa..0d25943 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1250,7 +1250,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
netdev_err(queue->vif->dev,
"txreq.offset: %x, size: %u, end: %lu\n",
txreq.offset, txreq.size,
- (txreq.offset&~PAGE_MASK) + txreq.size);
+ (unsigned long)(txreq.offset&~PAGE_MASK) + txreq.size);
xenvif_fatal_tx_err(queue->vif);
break;
}
--
1.7.10.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-06-01 19:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-01 10:30 [PATCH v2] xen: netback: fix printf format string warning Ian Campbell
2015-06-01 11:23 ` Wei Liu
2015-06-01 11:23 ` Wei Liu
2015-06-01 19:03 ` David Miller
2015-06-01 19:03 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2015-06-01 10:30 Ian Campbell
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.