[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJaqyWf7FEFZTu0eWNCt1Bd0UjpiFdLipq65vWsM=Nhkqhd3fQ@mail.gmail.com>
Date: Fri, 7 Oct 2022 19:37:48 +0200
From: Eugenio Perez Martin <eperezma@...hat.com>
To: Stefano Garzarella <sgarzare@...hat.com>
Cc: virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>
Subject: Re: [PATCH] vdpa: fix warning casts when building with C=2
On Thu, Aug 11, 2022 at 10:48 AM Stefano Garzarella <sgarzare@...hat.com> wrote:
>
> Use __virtio16_to_cpu() to read `max_virtqueue_pairs` field in
> virtio_net_config since its type is __virtio16.
>
> This silences the following warning when building with `make C=2`:
>
> ../drivers/vdpa/vdpa.c:811:19: warning: cast to restricted __le16
> ../drivers/vdpa/vdpa.c:811:19: warning: cast from restricted __virtio16
>
> Signed-off-by: Stefano Garzarella <sgarzare@...hat.com>
Acked-by: Eugenio PĂ©rez <eperezma@...hat.com>
> ---
> drivers/vdpa/vdpa.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c
> index c06c02704461..2466d5087478 100644
> --- a/drivers/vdpa/vdpa.c
> +++ b/drivers/vdpa/vdpa.c
> @@ -808,7 +808,7 @@ static int vdpa_dev_net_mq_config_fill(struct vdpa_device *vdev,
> if ((features & BIT_ULL(VIRTIO_NET_F_MQ)) == 0)
> return 0;
>
> - val_u16 = le16_to_cpu(config->max_virtqueue_pairs);
> + val_u16 = __virtio16_to_cpu(true, config->max_virtqueue_pairs);
> return nla_put_u16(msg, VDPA_ATTR_DEV_NET_CFG_MAX_VQP, val_u16);
> }
>
> --
> 2.37.1
>
Powered by blists - more mailing lists