[04/11] drivers/bus: use new logtype wrapper
diff mbox series

Message ID 1566214919-32250-5-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/bus/dpaa/dpaa_bus.c      | 26 ++++++++------------------
 drivers/bus/fslmc/fslmc_bus.c    |  9 ++-------
 drivers/bus/ifpga/ifpga_bus.c    |  8 ++------
 drivers/bus/vdev/vdev.c          |  8 ++------
 drivers/bus/vmbus/vmbus_common.c |  8 ++------
 5 files changed, 16 insertions(+), 43 deletions(-)

Patch
diff mbox series

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 07cc5c6..2eab45b 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -744,21 +744,11 @@  static struct rte_dpaa_bus rte_dpaa_bus = {
 
 RTE_REGISTER_BUS(FSL_DPAA_BUS_NAME, rte_dpaa_bus.bus);
 
-RTE_INIT(dpaa_init_log)
-{
-	dpaa_logtype_bus = rte_log_register("bus.dpaa");
-	if (dpaa_logtype_bus >= 0)
-		rte_log_set_level(dpaa_logtype_bus, RTE_LOG_NOTICE);
-
-	dpaa_logtype_mempool = rte_log_register("mempool.dpaa");
-	if (dpaa_logtype_mempool >= 0)
-		rte_log_set_level(dpaa_logtype_mempool, RTE_LOG_NOTICE);
-
-	dpaa_logtype_pmd = rte_log_register("pmd.net.dpaa");
-	if (dpaa_logtype_pmd >= 0)
-		rte_log_set_level(dpaa_logtype_pmd, RTE_LOG_NOTICE);
-
-	dpaa_logtype_eventdev = rte_log_register("pmd.event.dpaa");
-	if (dpaa_logtype_eventdev >= 0)
-		rte_log_set_level(dpaa_logtype_eventdev, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa_logtype_bus, "bus.dpaa",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);
+RTE_LOG_REGISTER(dpaa_logtype_mempool, "mempool.dpaa",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_MEMPOOL);
+RTE_LOG_REGISTER(dpaa_logtype_pmd, "pmd.net.dpaa",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(dpaa_logtype_eventdev, "pmd.event.dpaa",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index a2f4825..21488b1 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -646,10 +646,5 @@  struct rte_fslmc_bus rte_fslmc_bus = {
 
 RTE_REGISTER_BUS(FSLMC_BUS_NAME, rte_fslmc_bus.bus);
 
-RTE_INIT(fslmc_init_log)
-{
-	/* Bus level logs */
-	dpaa2_logtype_bus = rte_log_register("bus.fslmc");
-	if (dpaa2_logtype_bus >= 0)
-		rte_log_set_level(dpaa2_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_bus, "bus.fslmc",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);
diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index dfd6b1f..3458aac 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -474,9 +474,5 @@  static struct rte_bus rte_ifpga_bus = {
 
 RTE_REGISTER_BUS(IFPGA_BUS_NAME, rte_ifpga_bus);
 
-RTE_INIT(ifpga_init_log)
-{
-	ifpga_bus_logtype = rte_log_register("bus.ifpga");
-	if (ifpga_bus_logtype >= 0)
-		rte_log_set_level(ifpga_bus_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ifpga_bus_logtype, "bus.ifpga",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index a89ea23..b16e5a1 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -558,9 +558,5 @@  static struct rte_bus rte_vdev_bus = {
 
 RTE_REGISTER_BUS(vdev, rte_vdev_bus);
 
-RTE_INIT(vdev_init_log)
-{
-	vdev_logtype_bus = rte_log_register("bus.vdev");
-	if (vdev_logtype_bus >= 0)
-		rte_log_set_level(vdev_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vdev_logtype_bus, "bus.vdev",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index 48a219f..ff05e54 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -299,9 +299,5 @@  struct rte_vmbus_bus rte_vmbus_bus = {
 
 RTE_REGISTER_BUS(vmbus, rte_vmbus_bus.bus);
 
-RTE_INIT(vmbus_init_log)
-{
-	vmbus_logtype_bus = rte_log_register("bus.vmbus");
-	if (vmbus_logtype_bus >= 0)
-		rte_log_set_level(vmbus_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vmbus_logtype_bus, "bus.vmbus",
+	RTE_LOG_NOTICE, RTE_LOGTYPE_EAL);