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 1F44BA0350; Wed, 1 Jul 2020 12:46:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A602D1D15C; Wed, 1 Jul 2020 12:46:07 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 16BF21C2A7 for ; Wed, 1 Jul 2020 12:46:05 +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 061AV570031230; Wed, 1 Jul 2020 03:46:05 -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=ws3NpE2ZQj24btVHfvncq4Cu5zX3XqiP1fyFkE8ikctCuauFRoC79cX8ENqvvSYPoRt9 SV3k+YfGKHgHtV9hE4DWz2RcZq9XSRb9LXHeioZeyWgoElhxk7q1BdXeedADmS0PBM89 PPyp7J+pH0mrRO0XZak8xnyoUHakK72j7oyNf2KGOeQLGxl5eV24DpTWGWygdlR2Lxcc eIo2C5ou/lKWwaboLNMxKGmcdCbrlr14H+wIGSgK9KbFszMLd7dQToTlajAwm78wqQYh 28BC/uAxY9NJSDL0+zSBMOy1r4vAlj4b1eGT7Kwe2L5BqeOiENMOe7FQqJXUbzlSN4G1 pQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 31x5mnr1nn-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 01 Jul 2020 03:46:05 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Jul 2020 03:46:03 -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; Wed, 1 Jul 2020 03:46:03 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id B5D913F703F; Wed, 1 Jul 2020 03:46:00 -0700 (PDT) From: To: , Lee Daly , Fiona Trahe , Ashish Gupta , Sunila Sahu CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 16:14:24 +0530 Message-ID: <20200701104428.4149689-10-jerinj@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701104428.4149689-1-jerinj@marvell.com> References: <20200701064828.4097247-1-jerinj@marvell.com> <20200701104428.4149689-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_07:2020-07-01, 2020-07-01 signatures=0 Subject: [dpdk-dev] [PATCH v4 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