From patchwork Wed Jul 1 12:33: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: 72622 X-Patchwork-Delegate: david.marchand@redhat.com 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 61260A0523; Wed, 1 Jul 2020 14:35:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8541E1C435; Wed, 1 Jul 2020 14:34:59 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 5F1BE1C2F8 for ; Wed, 1 Jul 2020 14:34:58 +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 061CWKDC021713; Wed, 1 Jul 2020 05:34:57 -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=O6t8s8gdOrc9JypmjHFeZyA7pTR/OfHR7G0E6nGZwIHSnlgOqD5kqHMA8kXRGBqadpE+ c4oQ006ceSzgfpS8sO5rYlmC4UpoxYME+5KtpaA3rDevqHbbHLy61PB95Wg7vysX8PVl J3+/dxQRi9LsosMBVZNuCB+x1zlQekYhsPzgxrgf78bYMZthT7PfhT/vCCqUiY+6ozeH I1f6rA5l0fz+4jWcQ0xsxol9v0fcivWL8Y/p0Y3U7YLlHJ4r9O7HW1zoF5cUWOp78lYS FE0XpoWFC2edkYOXxA6HXFcpARaFytb2ZmOpSZT+l4Z5I02G+ab2o8GikOEEaRSs6aSs gw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 31x5mnrdk2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 01 Jul 2020 05:34:57 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Jul 2020 05:34:55 -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; Wed, 1 Jul 2020 05:34:55 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 6133A3F703F; Wed, 1 Jul 2020 05:34:52 -0700 (PDT) From: To: , Lee Daly , Fiona Trahe , Ashish Gupta , Sunila Sahu CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 18:03:43 +0530 Message-ID: <20200701123347.51144-10-jerinj@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701123347.51144-1-jerinj@marvell.com> References: <20200701104428.4149689-1-jerinj@marvell.com> <20200701123347.51144-1-jerinj@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-01_08:2020-07-01, 2020-07-01 signatures=0 Subject: [dpdk-dev] [PATCH v5 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);