[08/11] drivers/event: use new logtype wrapper

Message ID 1566214919-32250-9-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/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

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

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/event/dpaa2/dpaa2_eventdev.c | 8 ++------
 drivers/event/octeontx/ssovf_evdev.c | 8 ++------
 drivers/event/octeontx/timvf_evdev.c | 8 ++------
 drivers/event/opdl/opdl_evdev.c      | 9 ++-------
 drivers/event/sw/sw_evdev.c          | 8 ++------
 5 files changed, 10 insertions(+), 31 deletions(-)

Patch

diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 926b7ed..00701e3 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -1096,9 +1096,5 @@  static struct rte_vdev_driver vdev_eventdev_dpaa2_pmd = {
 
 RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DPAA2_PMD, vdev_eventdev_dpaa2_pmd);
 
-RTE_INIT(dpaa2_eventdev_init_log)
-{
-	dpaa2_logtype_event = rte_log_register("pmd.event.dpaa2");
-	if (dpaa2_logtype_event >= 0)
-		rte_log_set_level(dpaa2_logtype_event, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_event, "pmd.event.dpaa2",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index a273d4c..d1d2645 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -23,12 +23,8 @@ 
 int otx_logtype_ssovf;
 static uint8_t timvf_enable_stats;
 
-RTE_INIT(otx_ssovf_init_log)
-{
-	otx_logtype_ssovf = rte_log_register("pmd.event.octeontx");
-	if (otx_logtype_ssovf >= 0)
-		rte_log_set_level(otx_logtype_ssovf, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx_logtype_ssovf, "pmd.event.octeontx",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 /* SSOPF Mailbox messages */
 
diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c
index abbc9a7..f087ce2 100644
--- a/drivers/event/octeontx/timvf_evdev.c
+++ b/drivers/event/octeontx/timvf_evdev.c
@@ -6,12 +6,8 @@ 
 
 int otx_logtype_timvf;
 
-RTE_INIT(otx_timvf_init_log)
-{
-	otx_logtype_timvf = rte_log_register("pmd.event.octeontx.timer");
-	if (otx_logtype_timvf >= 0)
-		rte_log_set_level(otx_logtype_timvf, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx_logtype_timvf, "pmd.event.octeontx.timer",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
 
 struct __rte_packed timvf_mbox_dev_info {
 	uint64_t ring_active[4];
diff --git a/drivers/event/opdl/opdl_evdev.c b/drivers/event/opdl/opdl_evdev.c
index 3beca89..c0c1ec5 100644
--- a/drivers/event/opdl/opdl_evdev.c
+++ b/drivers/event/opdl/opdl_evdev.c
@@ -754,13 +754,8 @@  static struct rte_vdev_driver evdev_opdl_pmd_drv = {
 	.remove = opdl_remove
 };
 
-RTE_INIT(opdl_init_log)
-{
-	opdl_logtype_driver = rte_log_register("pmd.event.opdl.driver");
-	if (opdl_logtype_driver >= 0)
-		rte_log_set_level(opdl_logtype_driver, RTE_LOG_INFO);
-}
-
+RTE_LOG_REGISTER(opdl_logtype_driver, "pmd.event.opdl.driver",
+	RTE_LOG_INFO, RTE_LOGTYPE_PMD);
 
 RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_OPDL_PMD, evdev_opdl_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(event_opdl, NUMA_NODE_ARG "=<int>"
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index fb8e8be..0077fa8 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -1087,9 +1087,5 @@  RTE_PMD_REGISTER_PARAM_STRING(event_sw, NUMA_NODE_ARG "=<int> "
 /* declared extern in header, for access from other .c files */
 int eventdev_sw_log_level;
 
-RTE_INIT(evdev_sw_init_log)
-{
-	eventdev_sw_log_level = rte_log_register("pmd.event.sw");
-	if (eventdev_sw_log_level >= 0)
-		rte_log_set_level(eventdev_sw_log_level, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eventdev_sw_log_level, "pmd.event.sw",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);