From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73931A0350; Wed, 1 Jul 2020 08:50:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF1FD1C0D2; Wed, 1 Jul 2020 08:49:56 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 1EEAD1C0D2 for ; Wed, 1 Jul 2020 08:49:56 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616eNwP000798; Tue, 30 Jun 2020 23:49:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=i5PoeEqgA2mcueehtVVrLl6zLqxuxA9NXFsMMHmSJXo=; b=inWPsEOV/cZLlCXoBttKkK7MX/uo6a9nFn5PWWV3FLPDokAhE737t9okxhAHwPNQunLi j/0yBgKWI/ZTYgGZcq9bDTqICgnh/yqNKndvC/0IZc00LsBco68au+a97jysRaHIU24w 9uiQPxnryefMSxspTaU/K9GYRMtu5033BCAuGRv1MoMzjLGqWpTCqqipb1CKUr66+XoY pZO6aYpVHniQh/8l/072YKAE0FDwFO2C1ciwGZW73w2j7P+gJmJnE7L3WANQVeN8tT6y /Jf0RlIeQNIYidZILUKCsCwSghyEQ0nzW+OeD8tE3h8jBsd5+EwEyhn9ES0/WKwGY4fq Fw== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 31x5mnq88e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:49:55 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 23:49:53 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 30 Jun 2020 23:49:53 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 65DAC3F703F; Tue, 30 Jun 2020 23:49:50 -0700 (PDT) From: To: , Hemant Agrawal , Sachin Saxena , Rosen Xu , Stephen Hemminger CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 12:18:26 +0530 Message-ID: <20200701064828.4097247-12-jerinj@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701064828.4097247-1-jerinj@marvell.com> References: <20200701035840.4028056-1-jerinj@marvell.com> <20200701064828.4097247-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-01_03:2020-07-01, 2020-07-01 signatures=0 Subject: [dpdk-dev] [PATCH v3 11/13] drivers/bus: use log register macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob Use log register macro to avoid the code duplication in the log registration process. Signed-off-by: Jerin Jacob Acked-by: Sachin Saxena Acked-by: Adam Dybkowski --- drivers/bus/dpaa/dpaa_bus.c | 10 +--------- drivers/bus/fslmc/fslmc_bus.c | 11 +---------- drivers/bus/ifpga/ifpga_bus.c | 9 +-------- drivers/bus/vdev/vdev.c | 10 +--------- drivers/bus/vmbus/vmbus_common.c | 9 +-------- 5 files changed, 5 insertions(+), 44 deletions(-) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index d53fe6083..0d8b13e5f 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -42,8 +42,6 @@ #include #include -int dpaa_logtype_bus; - static struct rte_dpaa_bus rte_dpaa_bus; struct netcfg_info *dpaa_netcfg; @@ -749,10 +747,4 @@ 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); -} +RTE_LOG_REGISTER(dpaa_logtype_bus, bus.dpaa, NOTICE); diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index afbd82e8d..d9f403bd9 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -21,8 +21,6 @@ #include -int dpaa2_logtype_bus; - #define VFIO_IOMMU_GROUP_PATH "/sys/kernel/iommu_groups" #define FSLMC_BUS_NAME fslmc @@ -649,11 +647,4 @@ 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, NOTICE); diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c index addbc3e86..103915d43 100644 --- a/drivers/bus/ifpga/ifpga_bus.c +++ b/drivers/bus/ifpga/ifpga_bus.c @@ -32,7 +32,6 @@ #include "ifpga_logs.h" #include "ifpga_common.h" -int ifpga_bus_logtype; /* Forward declaration to access Intel FPGA bus * on which iFPGA devices are connected @@ -474,10 +473,4 @@ 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, NOTICE); diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index a89ea2353..d746149a2 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -27,8 +27,6 @@ #define VDEV_MP_KEY "bus_vdev_mp" -int vdev_logtype_bus; - /* Forward declare to access virtual bus name */ static struct rte_bus rte_vdev_bus; @@ -557,10 +555,4 @@ 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, NOTICE); diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c index 3adef01c9..4c9ac33ac 100644 --- a/drivers/bus/vmbus/vmbus_common.c +++ b/drivers/bus/vmbus/vmbus_common.c @@ -22,7 +22,6 @@ #include "private.h" -int vmbus_logtype_bus; extern struct rte_vmbus_bus rte_vmbus_bus; /* map a particular resource from a file */ @@ -298,10 +297,4 @@ 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, NOTICE); -- 2.27.0