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 9E7B0A0350; Wed, 1 Jul 2020 08:49:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CB6871C0AD; Wed, 1 Jul 2020 08:49:46 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A5CA81C07D for ; Wed, 1 Jul 2020 08:49:45 +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 0616eNiG000789; Tue, 30 Jun 2020 23:49:44 -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=dJUgTd4vyhH/CZP2JpxRdZJ5Jj29HinHiE8+Y+mkKZTjwveJyrgigc11oDOeNVzBh+HP CKtMLkCstQRmp6L3KKmF704hFDLrp96Ro2k1zmeBngWlqHn+03c3IgPa8SgC0MC6ChhP wBWuMwS6F+JZMkeCkcdEf04lb1m3Cqilp+MXH+TfJQl6XR7usFDEQw6+xgU8H9YyrhzL mkDz9z+pBY23h1ad81tBmWXzQFpr2wd4JUeuXDw3N1MVa4h74VFlOlLDCXQpEfHjsV1Q NnlUAD0zQd8/pIXQ4mQo0IL7MKxp4TuklpR+o6YARkR3hFXDbAFWRW6OT4xq7NXsFPBW Dg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 31x5mnq87b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:49:44 -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; Tue, 30 Jun 2020 23:49:43 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 23:49:42 -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:42 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 771AA3F703F; Tue, 30 Jun 2020 23:49:39 -0700 (PDT) From: To: , Lee Daly , Fiona Trahe , Ashish Gupta , Sunila Sahu CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 12:18:24 +0530 Message-ID: <20200701064828.4097247-10-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 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