[03/11] drivers/baseband: use new logtype wrapper
diff mbox series

Message ID 1566214919-32250-4-git-send-email-david.marchand@redhat.com
State Superseded
Delegated to: Thomas Monjalon
Headers show
Series
  • Fixing log levels for dynamically loaded drivers
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

David Marchand Aug. 19, 2019, 11:41 a.m. UTC
Make use of the newly introduced wrapper.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c     | 11 ++++-------
 drivers/baseband/null/bbdev_null.c               |  8 ++------
 drivers/baseband/turbo_sw/bbdev_turbo_software.c |  8 ++------
 3 files changed, 8 insertions(+), 19 deletions(-)

Comments

Nicolas Chautru Aug. 19, 2019, 3:39 p.m. UTC | #1
On 8/19/19, David Marchand wrote:
> Make use of the newly introduced wrapper.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>

Patch
diff mbox series

diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
index 7e05b94..397ca8f 100644
--- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
+++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
@@ -2663,13 +2663,10 @@  RTE_PMD_REGISTER_PCI(FPGA_LTE_FEC_VF_DRIVER_NAME, fpga_lte_fec_pci_vf_driver);
 RTE_PMD_REGISTER_PCI_TABLE(FPGA_LTE_FEC_VF_DRIVER_NAME,
 		pci_id_fpga_lte_fec_vf_map);
 
-RTE_INIT(fpga_lte_fec_init_log)
-{
-	fpga_lte_fec_logtype = rte_log_register("pmd.bb.fpga_lte_fec");
-	if (fpga_lte_fec_logtype >= 0)
+RTE_LOG_REGISTER(fpga_lte_fec_logtype, "pmd.bb.fpga_lte_fec",
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
-		rte_log_set_level(fpga_lte_fec_logtype, RTE_LOG_DEBUG);
+	RTE_LOG_DEBUG
 #else
-		rte_log_set_level(fpga_lte_fec_logtype, RTE_LOG_NOTICE);
+	RTE_LOG_NOTICE
 #endif
-}
+	, RTE_LOGTYPE_PMD);
diff --git a/drivers/baseband/null/bbdev_null.c b/drivers/baseband/null/bbdev_null.c
index 2f25151..029c308 100644
--- a/drivers/baseband/null/bbdev_null.c
+++ b/drivers/baseband/null/bbdev_null.c
@@ -348,9 +348,5 @@  RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME,
 	BBDEV_NULL_SOCKET_ID_ARG"=<int>");
 RTE_PMD_REGISTER_ALIAS(DRIVER_NAME, bbdev_null);
 
-RTE_INIT(null_bbdev_init_log)
-{
-	bbdev_null_logtype = rte_log_register("pmd.bb.null");
-	if (bbdev_null_logtype >= 0)
-		rte_log_set_level(bbdev_null_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bbdev_null_logtype, "pmd.bb.null",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
index f2fe7a2..fb0bbbe 100644
--- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c
+++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
@@ -1988,9 +1988,5 @@  RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME,
 	TURBO_SW_SOCKET_ID_ARG"=<int>");
 RTE_PMD_REGISTER_ALIAS(DRIVER_NAME, turbo_sw);
 
-RTE_INIT(turbo_sw_bbdev_init_log)
-{
-	bbdev_turbo_sw_logtype = rte_log_register("pmd.bb.turbo_sw");
-	if (bbdev_turbo_sw_logtype >= 0)
-		rte_log_set_level(bbdev_turbo_sw_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(bbdev_turbo_sw_logtype, "pmd.bb.turbo_sw",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);