diff options
-rw-r--r-- | drivers/net/sfc/ethtool.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index aad0d1b36e1c..eab3e5c61c7b 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -274,8 +274,11 @@ static void efx_fill_test(unsigned int test_index, | |||
274 | 274 | ||
275 | /* Fill string, if applicable */ | 275 | /* Fill string, if applicable */ |
276 | if (strings) { | 276 | if (strings) { |
277 | snprintf(unit_str.name, sizeof(unit_str.name), | 277 | if (strchr(unit_format, '%')) |
278 | unit_format, unit_id); | 278 | snprintf(unit_str.name, sizeof(unit_str.name), |
279 | unit_format, unit_id); | ||
280 | else | ||
281 | strcpy(unit_str.name, unit_format); | ||
279 | snprintf(test_str.name, sizeof(test_str.name), | 282 | snprintf(test_str.name, sizeof(test_str.name), |
280 | test_format, test_id); | 283 | test_format, test_id); |
281 | snprintf(strings[test_index].name, | 284 | snprintf(strings[test_index].name, |
@@ -284,7 +287,6 @@ static void efx_fill_test(unsigned int test_index, | |||
284 | } | 287 | } |
285 | } | 288 | } |
286 | 289 | ||
287 | #define EFX_PORT_NAME "port%d", 0 | ||
288 | #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel | 290 | #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel |
289 | #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue | 291 | #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue |
290 | #define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue | 292 | #define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue |
@@ -320,11 +322,11 @@ static int efx_fill_loopback_test(struct efx_nic *efx, | |||
320 | } | 322 | } |
321 | efx_fill_test(test_index++, strings, data, | 323 | efx_fill_test(test_index++, strings, data, |
322 | &lb_tests->rx_good, | 324 | &lb_tests->rx_good, |
323 | EFX_PORT_NAME, | 325 | "rx", 0, |
324 | EFX_LOOPBACK_NAME(mode, "rx_good")); | 326 | EFX_LOOPBACK_NAME(mode, "rx_good")); |
325 | efx_fill_test(test_index++, strings, data, | 327 | efx_fill_test(test_index++, strings, data, |
326 | &lb_tests->rx_bad, | 328 | &lb_tests->rx_bad, |
327 | EFX_PORT_NAME, | 329 | "rx", 0, |
328 | EFX_LOOPBACK_NAME(mode, "rx_bad")); | 330 | EFX_LOOPBACK_NAME(mode, "rx_bad")); |
329 | 331 | ||
330 | return test_index; | 332 | return test_index; |
@@ -372,7 +374,7 @@ static int efx_ethtool_fill_self_tests(struct efx_nic *efx, | |||
372 | efx_fill_test(n++, strings, data, &tests->registers, | 374 | efx_fill_test(n++, strings, data, &tests->registers, |
373 | "core", 0, "registers", NULL); | 375 | "core", 0, "registers", NULL); |
374 | efx_fill_test(n++, strings, data, &tests->phy, | 376 | efx_fill_test(n++, strings, data, &tests->phy, |
375 | EFX_PORT_NAME, "phy", NULL); | 377 | "phy", 0, "bist", NULL); |
376 | 378 | ||
377 | /* Loopback tests */ | 379 | /* Loopback tests */ |
378 | for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) { | 380 | for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) { |