summaryrefslogtreecommitdiff
path: root/lib/librte_kni/rte_kni.c
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2014-06-21 00:34:30 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-06-27 02:31:08 +0200
commite8ed6c78177fbbafa326d9efc590a51705848200 (patch)
tree7e98cac5a638c6e1cabf1ac477b31300575c534d /lib/librte_kni/rte_kni.c
parente9199e82fcd210a64d0c34ebcab78d714dc4b453 (diff)
downloaddpdk-e8ed6c78177fbbafa326d9efc590a51705848200.zip
dpdk-e8ed6c78177fbbafa326d9efc590a51705848200.tar.gz
dpdk-e8ed6c78177fbbafa326d9efc590a51705848200.tar.xz
eal: fix usage of printf-like functions
Mark the rte_log, cmdline_printf and rte_snprintf functions as being printf-style functions. This causes compilation errors due to mis-matched parameter types, so the parameter types are fixed where appropriate. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Diffstat (limited to 'lib/librte_kni/rte_kni.c')
-rw-r--r--lib/librte_kni/rte_kni.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 89088e7..2416e95 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -158,7 +158,7 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
}
}
- rte_snprintf(intf_name, RTE_KNI_NAMESIZE, conf->name);
+ rte_snprintf(intf_name, RTE_KNI_NAMESIZE, "%s", conf->name);
rte_snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "KNI_INFO_%s", intf_name);
mz = kni_memzone_reserve(mz_name, sizeof(struct rte_kni),
SOCKET_ID_ANY, 0);
@@ -184,8 +184,8 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
dev_info.group_id = conf->group_id;
dev_info.mbuf_size = conf->mbuf_size;
- rte_snprintf(ctx->name, RTE_KNI_NAMESIZE, intf_name);
- rte_snprintf(dev_info.name, RTE_KNI_NAMESIZE, intf_name);
+ rte_snprintf(ctx->name, RTE_KNI_NAMESIZE, "%s", intf_name);
+ rte_snprintf(dev_info.name, RTE_KNI_NAMESIZE, "%s", intf_name);
RTE_LOG(INFO, KNI, "pci: %02x:%02x:%02x \t %02x:%02x\n",
dev_info.bus, dev_info.devid, dev_info.function,
@@ -291,7 +291,7 @@ rte_kni_release(struct rte_kni *kni)
if (!kni || !kni->in_use)
return -1;
- rte_snprintf(dev_info.name, sizeof(dev_info.name), kni->name);
+ rte_snprintf(dev_info.name, sizeof(dev_info.name), "%s", kni->name);
if (ioctl(kni_fd, RTE_KNI_IOCTL_RELEASE, &dev_info) < 0) {
RTE_LOG(ERR, KNI, "Fail to release kni device\n");
return -1;