summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhu Lingshan <lingshan.zhu@intel.com>2022-09-29 09:45:54 +0800
committerMichael S. Tsirkin <mst@redhat.com>2022-10-07 20:00:43 -0400
commit35b37c33eb75f532606e8d333a4eb63d4c22401b (patch)
treef4f3a6584756e9c0e021a4f12d22c248b40c4509
parent9d97aa124cde0264587b034bc34438acc2b44ecf (diff)
vDPA: fix spars cast warning in vdpa_dev_net_mq_config_fill
This commit fixes spars warnings: cast to restricted __le16 in function vdpa_dev_net_mq_config_fill() Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20220929014555.112323-6-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--drivers/vdpa/vdpa.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c
index 2774e071991c..e5e18124ed12 100644
--- a/drivers/vdpa/vdpa.c
+++ b/drivers/vdpa/vdpa.c
@@ -813,7 +813,8 @@ static int vdpa_dev_net_mq_config_fill(struct sk_buff *msg, u64 features,
(features & BIT_ULL(VIRTIO_NET_F_RSS)) == 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);
}