From patchwork Wed Jun 17 06:30:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob Kollanukkaran X-Patchwork-Id: 71658 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E13F3A04A5; Wed, 17 Jun 2020 08:31:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B67771B13C; Wed, 17 Jun 2020 08:31:21 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 2B5821B13C for ; Wed, 17 Jun 2020 08:31:20 +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 05H6Q4pr010591; Tue, 16 Jun 2020 23:31:19 -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=v+c5gstaoKDy2UPPQr+cuzcqFZGPI5x+ccwhTnpTU78=; b=wSHie2wPV0mHe0hvekSXDAxXN9xgD3/59bMvRZ6KXqi2x8Zdpe466bGl7L6FOj0jAO+D X1g3f5syHrCVwWY0vJ5t/0bGyAH9NU7Ft2X1ucH+fA2nVF7BitKfVGOLkm5DtUQnIdwJ pbwcdghEgsoVJ7RAr0TcmrAFoQx0W8UEE8K26nPX/SHkjJO6lyTwQ4JIjOIrDcZvcUMJ vNrZPprAeg+a7mBBU6cRIUODqCMDqyVT26UrRFlFFaAWe7e0nS6nwuPevoplQ4ZSP72e qr7RWU6OdqBQ+PfWxsAtxBvNMS38dDy0I3wd5GBombHoqu9ui3I95BCWanBtFw6oBrRd eg== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 31q658jn05-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 16 Jun 2020 23:31:19 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 Jun 2020 23:31:17 -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, 16 Jun 2020 23:31:17 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 1B03E3F7040; Tue, 16 Jun 2020 23:31:14 -0700 (PDT) From: To: , Lee Daly , Fiona Trahe , Ashish Gupta , Sunila Sahu CC: , , , Jerin Jacob Date: Wed, 17 Jun 2020 12:00:43 +0530 Message-ID: <20200617063047.1555518-10-jerinj@marvell.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200617063047.1555518-1-jerinj@marvell.com> References: <20200617063047.1555518-1-jerinj@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-16_13:2020-06-16, 2020-06-16 signatures=0 Subject: [dpdk-dev] [PATCH 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 --- 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);