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 94C98A0350; Wed, 1 Jul 2020 06:00:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 99B6D1BFB6; Wed, 1 Jul 2020 06:00:16 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id E90891BF6C for ; Wed, 1 Jul 2020 06:00:13 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0613tWxZ001233; Tue, 30 Jun 2020 21:00:12 -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=P+rvVywVJAy1MNLX2oOyHCK8kXkVIvrb4Qp4ABUl1g0=; b=DOvUjV+6P5YCE5yeG74ZBhK0sUTiPTTMzv7TOC9rrMAUojQIyflyIs0HzeLbDKt+qfrI u1k3MdFuah3k1USXwkuHFGWkZ/Jt9fYhtDTbIdcYIpD1DMv+zE+7pMPgQqhTlix3+g6v CgHHsjhwzVDEj7rbYQDrkZPex5picGbGvZp9fKTpp0RV5ZIeV7A/8HdvWw81V7klJRHa 3D84MQpNrR5DAaxPU+tOxKZR46hg2W/KBGNgKjroWWZ83O+zNQsW58n5GfO//Gu9pRNR TEC543iB8ab2jwkLjEracJIfYL/fe5K+kdmXI/BVAK2D6UqY6XCo/ylXdPE08QY0DJku fg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 31y0ws2wnq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 21:00:12 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 21:00:10 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 30 Jun 2020 21:00:11 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id BD4A83F704A; Tue, 30 Jun 2020 21:00:07 -0700 (PDT) From: To: , Lee Daly , Fiona Trahe , Ashish Gupta , Sunila Sahu CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 09:28:36 +0530 Message-ID: <20200701035840.4028056-10-jerinj@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701035840.4028056-1-jerinj@marvell.com> References: <20200617063047.1555518-1-jerinj@marvell.com> <20200701035840.4028056-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_01:2020-07-01, 2020-06-30 signatures=0 Subject: [dpdk-dev] [PATCH v2 09/13] drivers/compress: 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: Adam Dybkowski --- drivers/compress/isal/isal_compress_pmd.c | 10 +--------- drivers/compress/octeontx/otx_zip_pmd.c | 10 +--------- drivers/compress/zlib/zlib_pmd.c | 10 +--------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c index 7d2b05c91..0ecca12a8 100644 --- a/drivers/compress/isal/isal_compress_pmd.c +++ b/drivers/compress/isal/isal_compress_pmd.c @@ -25,8 +25,6 @@ #define ISAL_VERSION_STRING \ ISAL_TOSTRING(ISAL_MAJOR_VERSION, ISAL_MINOR_VERSION, ISAL_PATCH_VERSION) -int isal_logtype_driver; - /* Verify and set private xform parameters */ int isal_comp_set_priv_xform_parameters(struct isal_priv_xform *priv_xform, @@ -752,10 +750,4 @@ static struct rte_vdev_driver compdev_isal_pmd_drv = { RTE_PMD_REGISTER_VDEV(COMPDEV_NAME_ISAL_PMD, compdev_isal_pmd_drv); RTE_PMD_REGISTER_PARAM_STRING(COMPDEV_NAME_ISAL_PMD, "socket_id="); - -RTE_INIT(isal_init_log) -{ - isal_logtype_driver = rte_log_register("pmd.compress.isal"); - if (isal_logtype_driver >= 0) - rte_log_set_level(isal_logtype_driver, RTE_LOG_INFO); -} +RTE_LOG_REGISTER(isal_logtype_driver, pmd.compress.isal, INFO); diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c index bff8ef035..bee90fc7c 100644 --- a/drivers/compress/octeontx/otx_zip_pmd.c +++ b/drivers/compress/octeontx/otx_zip_pmd.c @@ -11,8 +11,6 @@ #include "otx_zip.h" -int octtx_zip_logtype_driver; - static const struct rte_compressdev_capabilities octtx_zip_pmd_capabilities[] = { { .algo = RTE_COMP_ALGO_DEFLATE, @@ -648,10 +646,4 @@ static struct rte_pci_driver octtx_zip_pmd = { RTE_PMD_REGISTER_PCI(COMPRESSDEV_NAME_ZIP_PMD, octtx_zip_pmd); RTE_PMD_REGISTER_PCI_TABLE(COMPRESSDEV_NAME_ZIP_PMD, pci_id_octtx_zipvf_table); - -RTE_INIT(octtx_zip_init_log) -{ - octtx_zip_logtype_driver = rte_log_register("pmd.compress.octeontx"); - if (octtx_zip_logtype_driver >= 0) - rte_log_set_level(octtx_zip_logtype_driver, RTE_LOG_INFO); -} +RTE_LOG_REGISTER(octtx_zip_logtype_driver, pmd.compress.octeontx, INFO); diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c index e39be2ed8..8a79d15c9 100644 --- a/drivers/compress/zlib/zlib_pmd.c +++ b/drivers/compress/zlib/zlib_pmd.c @@ -7,8 +7,6 @@ #include "zlib_pmd_private.h" -int zlib_logtype_driver; - /** Compute next mbuf in the list, assign data buffer and length, * returns 0 if mbuf is NULL */ @@ -428,10 +426,4 @@ static struct rte_vdev_driver zlib_pmd_drv = { }; RTE_PMD_REGISTER_VDEV(COMPRESSDEV_NAME_ZLIB_PMD, zlib_pmd_drv); - -RTE_INIT(zlib_init_log) -{ - zlib_logtype_driver = rte_log_register("pmd.compress.zlib"); - if (zlib_logtype_driver >= 0) - rte_log_set_level(zlib_logtype_driver, RTE_LOG_INFO); -} +RTE_LOG_REGISTER(zlib_logtype_driver, pmd.compress.zlib, INFO); -- 2.27.0