Commit c2fbcc94 authored by Karen Sornek's avatar Karen Sornek Committed by Tony Nguyen

iavf: Refactor string format to avoid static analysis warnings

Change format to match variable type that is used in string.

Use %u format for unsigned variable and %d format for signed variable
to remove static analysis warnings.
Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@intel.com>
Signed-off-by: default avatarKaren Sornek <karen.sornek@intel.com>
Tested-by: default avatarGeorge Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent fbe66f57
...@@ -463,14 +463,14 @@ iavf_request_traffic_irqs(struct iavf_adapter *adapter, char *basename) ...@@ -463,14 +463,14 @@ iavf_request_traffic_irqs(struct iavf_adapter *adapter, char *basename)
if (q_vector->tx.ring && q_vector->rx.ring) { if (q_vector->tx.ring && q_vector->rx.ring) {
snprintf(q_vector->name, sizeof(q_vector->name), snprintf(q_vector->name, sizeof(q_vector->name),
"iavf-%s-TxRx-%d", basename, rx_int_idx++); "iavf-%s-TxRx-%u", basename, rx_int_idx++);
tx_int_idx++; tx_int_idx++;
} else if (q_vector->rx.ring) { } else if (q_vector->rx.ring) {
snprintf(q_vector->name, sizeof(q_vector->name), snprintf(q_vector->name, sizeof(q_vector->name),
"iavf-%s-rx-%d", basename, rx_int_idx++); "iavf-%s-rx-%u", basename, rx_int_idx++);
} else if (q_vector->tx.ring) { } else if (q_vector->tx.ring) {
snprintf(q_vector->name, sizeof(q_vector->name), snprintf(q_vector->name, sizeof(q_vector->name),
"iavf-%s-tx-%d", basename, tx_int_idx++); "iavf-%s-tx-%u", basename, tx_int_idx++);
} else { } else {
/* skip this unused q_vector */ /* skip this unused q_vector */
continue; continue;
......
...@@ -1025,7 +1025,7 @@ static void iavf_print_link_message(struct iavf_adapter *adapter) ...@@ -1025,7 +1025,7 @@ static void iavf_print_link_message(struct iavf_adapter *adapter)
} else if (link_speed_mbps == SPEED_UNKNOWN) { } else if (link_speed_mbps == SPEED_UNKNOWN) {
snprintf(speed, IAVF_MAX_SPEED_STRLEN, "%s", "Unknown Mbps"); snprintf(speed, IAVF_MAX_SPEED_STRLEN, "%s", "Unknown Mbps");
} else { } else {
snprintf(speed, IAVF_MAX_SPEED_STRLEN, "%u %s", snprintf(speed, IAVF_MAX_SPEED_STRLEN, "%d %s",
link_speed_mbps, "Mbps"); link_speed_mbps, "Mbps");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment