From: Kevin Traynor Date: Fri, 6 Mar 2020 12:06:51 +0000 (+0000) Subject: net/hinic: fix snprintf length of cable info X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=9c84acab47e8eee2736b70edc54f36bb1bc17c57 net/hinic: fix snprintf length of cable info Correct length and remove unnecessary brackets. Fixes: d9ce1917941c ("net/hinic/base: add hardware operation") Cc: stable@dpdk.org Signed-off-by: Kevin Traynor Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c index 8b16897ade..b6c821a2ad 100644 --- a/drivers/net/hinic/base/hinic_pmd_hwdev.c +++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c @@ -1390,7 +1390,7 @@ static void print_cable_info(struct hinic_link_info *info) } memcpy(tmp_vendor, info->vendor_name, sizeof(info->vendor_name)); - snprintf(tmp_str, (sizeof(tmp_str) - 1), + snprintf(tmp_str, sizeof(tmp_str), "Vendor: %s, %s, %s, length: %um, max_speed: %uGbps", tmp_vendor, info->sfp_type ? "SFP" : "QSFP", port_type, info->cable_length, info->cable_max_speed);