Netdev List
 help / color / mirror / Atom feed
* [PATCH vhost] virtio_net: fix build warnings
@ 2022-03-07  9:40 Xuan Zhuo
  2022-03-07 10:00 ` Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Xuan Zhuo @ 2022-03-07  9:40 UTC (permalink / raw)
  To: virtualization
  Cc: Michael S. Tsirkin, Jason Wang, David S. Miller, Jakub Kicinski,
	netdev, Stephen Rothwell

These warnings appear on some platforms (arm multi_v7_defconfig). This
patch fixes these warnings.

drivers/net/virtio_net.c: In function 'virtnet_rx_vq_reset':
drivers/net/virtio_net.c:1823:63: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat=]
 1823 |                    "reset rx reset vq fail: rx queue index: %ld err: %d\n",
      |                                                             ~~^
      |                                                               |
      |                                                               long int
      |                                                             %d
 1824 |                    rq - vi->rq, err);
      |                    ~~~~~~~~~~~
      |                       |
      |                       int
drivers/net/virtio_net.c: In function 'virtnet_tx_vq_reset':
drivers/net/virtio_net.c:1873:63: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat=]
 1873 |                    "reset tx reset vq fail: tx queue index: %ld err: %d\n",
      |                                                             ~~^
      |                                                               |
      |                                                               long int
      |                                                             %d
 1874 |                    sq - vi->sq, err);
      |                    ~~~~~~~~~~~
      |                       |
      |                       int

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
 drivers/net/virtio_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 1fa2d632a994..4d629d1ea894 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1820,7 +1820,7 @@ static int virtnet_rx_vq_reset(struct virtnet_info *vi,
 
 err:
 	netdev_err(vi->dev,
-		   "reset rx reset vq fail: rx queue index: %ld err: %d\n",
+		   "reset rx reset vq fail: rx queue index: %td err: %d\n",
 		   rq - vi->rq, err);
 	virtnet_napi_enable(rq->vq, &rq->napi);
 	return err;
@@ -1870,7 +1870,7 @@ static int virtnet_tx_vq_reset(struct virtnet_info *vi,
 
 err:
 	netdev_err(vi->dev,
-		   "reset tx reset vq fail: tx queue index: %ld err: %d\n",
+		   "reset tx reset vq fail: tx queue index: %td err: %d\n",
 		   sq - vi->sq, err);
 	virtnet_napi_tx_enable(vi, sq->vq, &sq->napi);
 	return err;
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-07 10:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-07  9:40 [PATCH vhost] virtio_net: fix build warnings Xuan Zhuo
2022-03-07 10:00 ` Michael S. Tsirkin
2022-03-07 10:04   ` Xuan Zhuo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox