Skip to content

Commit

Permalink
vDPA: fix spars cast warning in vdpa_dev_net_mq_config_fill
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zhu Lingshan authored and Michael S. Tsirkin committed Oct 8, 2022
1 parent 9d97aa1 commit 35b37c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/vdpa/vdpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 35b37c3

Please sign in to comment.