When registering a common logtype for this driver, instead of
explicitly fall back to EAL, rely on the log registration macro to
achieve the same.

Signed-off-by: David Marchand <david.march...@redhat.com>
---
 drivers/net/sfc/sfc_ethdev.c | 12 +-----------
 drivers/net/sfc/sfc_log.h    |  2 +-
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 92ca5e7a60..24686a1eaf 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -37,8 +37,6 @@
 #define SFC_XSTAT_ID_INVALID_VAL  UINT64_MAX
 #define SFC_XSTAT_ID_INVALID_NAME '\0'
 
-uint32_t sfc_logtype_driver;
-
 static struct sfc_dp_list sfc_dp_head =
        TAILQ_HEAD_INITIALIZER(sfc_dp_head);
 
@@ -3618,12 +3616,4 @@ RTE_PMD_REGISTER_PARAM_STRING(net_sfc_efx,
        SFC_KVARG_FW_VARIANT "=" SFC_KVARG_VALUES_FW_VARIANT " "
        SFC_KVARG_RXD_WAIT_TIMEOUT_NS "=<long> "
        SFC_KVARG_STATS_UPDATE_PERIOD_MS "=<long>");
-
-RTE_INIT(sfc_driver_register_logtype)
-{
-       int ret;
-
-       ret = rte_log_register_type_and_pick_level(SFC_LOGTYPE_PREFIX "driver",
-                                                  RTE_LOG_NOTICE);
-       sfc_logtype_driver = (ret < 0) ? RTE_LOGTYPE_EAL : ret;
-}
+RTE_LOG_REGISTER_SUFFIX(sfc_logtype_driver, "driver", NOTICE);
diff --git a/drivers/net/sfc/sfc_log.h b/drivers/net/sfc/sfc_log.h
index d54277cb7a..10a9ce6ced 100644
--- a/drivers/net/sfc/sfc_log.h
+++ b/drivers/net/sfc/sfc_log.h
@@ -11,7 +11,7 @@
 #define _SFC_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_logtype_driver;
+extern int sfc_logtype_driver;
 
 /** Common log type name prefix */
 #define SFC_LOGTYPE_PREFIX     "pmd.net.sfc."
-- 
2.45.2

Reply via email to