mirror of
https://github.com/openvswitch/ovs
synced 2025-09-01 14:55:18 +00:00
netdev-dpdk: Avoid warning for snprintf() call.
lib/netdev-dpdk.c: In function : lib/netdev-dpdk.c:2865:49: warning: output may be truncated before the last format character [-Wformat-truncation=] snprintf(vhost_vring, 16, "vring_%d_size", i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suggested-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Ilya Maximets <i.maximets@samsung.com>
This commit is contained in:
@@ -2883,11 +2883,10 @@ netdev_dpdk_vhost_user_get_status(const struct netdev *netdev,
|
|||||||
|
|
||||||
for (int i = 0; i < vring_num; i++) {
|
for (int i = 0; i < vring_num; i++) {
|
||||||
struct rte_vhost_vring vring;
|
struct rte_vhost_vring vring;
|
||||||
char vhost_vring[16];
|
|
||||||
|
|
||||||
rte_vhost_get_vhost_vring(vid, i, &vring);
|
rte_vhost_get_vhost_vring(vid, i, &vring);
|
||||||
snprintf(vhost_vring, 16, "vring_%d_size", i);
|
smap_add_nocopy(args, xasprintf("vring_%d_size", i),
|
||||||
smap_add_format(args, vhost_vring, "%d", vring.size);
|
xasprintf("%d", vring.size));
|
||||||
}
|
}
|
||||||
|
|
||||||
ovs_mutex_unlock(&dev->mutex);
|
ovs_mutex_unlock(&dev->mutex);
|
||||||
|
Reference in New Issue
Block a user