[v5,02/18] common/sfc_efx: remove use of PMD logtype

Message ID 20231221164841.125006-3-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Replace uses of PMD logtype |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Dec. 21, 2023, 4:46 p.m. UTC
  This code was implemented in a slightly different manner
than all the other logging code (for no good reason).
Make it the same and handle errors in same way as
other drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/sfc_efx/sfc_efx.c     | 11 ++---------
 drivers/common/sfc_efx/sfc_efx_log.h |  2 +-
 2 files changed, 3 insertions(+), 10 deletions(-)
  

Patch

diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c
index 2dc5545760b8..5eeffb065b0d 100644
--- a/drivers/common/sfc_efx/sfc_efx.c
+++ b/drivers/common/sfc_efx/sfc_efx.c
@@ -15,7 +15,7 @@ 
 #include "sfc_efx_log.h"
 #include "sfc_efx.h"
 
-uint32_t sfc_efx_logtype;
+int sfc_efx_logtype;
 
 static int
 sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key,
@@ -117,11 +117,4 @@  sfc_efx_family(struct rte_pci_device *pci_dev,
 	return rc;
 }
 
-RTE_INIT(sfc_efx_register_logtype)
-{
-	int ret;
-
-	ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx",
-						   RTE_LOG_NOTICE);
-	sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
-}
+RTE_LOG_REGISTER_DEFAULT(sfc_efx_logtype, NOTICE);
diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h
index 694455c1b14e..1519ebdc175f 100644
--- a/drivers/common/sfc_efx/sfc_efx_log.h
+++ b/drivers/common/sfc_efx/sfc_efx_log.h
@@ -11,7 +11,7 @@ 
 #define _SFC_EFX_LOG_H_
 
 /** Generic driver log type */
-extern uint32_t sfc_efx_logtype;
+extern int sfc_efx_logtype;
 
 /** Log message, add a prefix and a line break */
 #define SFC_EFX_LOG(level, ...) \