Skip to content

Commit 35b37c3

Browse files
ls-zhumstsirkin
authored andcommitted
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>
1 parent 9d97aa1 commit 35b37c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/vdpa/vdpa.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,8 @@ static int vdpa_dev_net_mq_config_fill(struct sk_buff *msg, u64 features,
813813
(features & BIT_ULL(VIRTIO_NET_F_RSS)) == 0)
814814
return 0;
815815

816-
val_u16 = le16_to_cpu(config->max_virtqueue_pairs);
816+
val_u16 = __virtio16_to_cpu(true, config->max_virtqueue_pairs);
817+
817818
return nla_put_u16(msg, VDPA_ATTR_DEV_NET_CFG_MAX_VQP, val_u16);
818819
}
819820

0 commit comments

Comments
 (0)