net/hinic: fix snprintf length of cable info
authorKevin Traynor <ktraynor@redhat.com>
Fri, 6 Mar 2020 12:06:51 +0000 (12:06 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 18 Mar 2020 09:21:42 +0000 (10:21 +0100)
Correct length and remove unnecessary brackets.

Fixes: d9ce1917941c ("net/hinic/base: add hardware operation")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/hinic/base/hinic_pmd_hwdev.c

index 8b16897..b6c821a 100644 (file)
@@ -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);