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 8F9DCA0350; Sun, 21 Jun 2020 11:52:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D857A1C01B; Sun, 21 Jun 2020 11:52:49 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140080.outbound.protection.outlook.com [40.107.14.80]) by dpdk.org (Postfix) with ESMTP id 363881C002 for ; Sun, 21 Jun 2020 11:52:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JRtJ0A8GefDoSPdMayP2MGy8mi6qFrkJkVaP8ENQ2e6nDR6sfCOtjn8fhl9nHC1hytWr8gTHHHSjxqb0zX7o+iW+CbWZNfyR8F9FPNNqozL6lNDeSK8OrCwHLVY5YDiDTKfyJbGiDx+9nYXOApvLpCRYEmWD/qwn0wE3UQwL1Y74SosjYLxG02dlNCuAtc915TFnGrAQOSXgVFHBwKtC/wLEMU9WadnQRexqzaAWeTyu+ubGRx6TTswkODE2dJKKQ7wzYXAoThMugWLeH+TALSj92Plsi5wA7WhXRqkZpdnBsdHM137Ca7WfeDFyIhjeKxiyRlU5I6pPrmVjbgI2gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ecQUztVbB+tZgWjwZfMHkpjRZRsON943S3c0L1Qe/eA=; b=VjMUDGI40yb0vsOJf6U3JGCqQ+3noizlWZYTxo4oy5RRAlUCyOKuvN47mhnPl+cV+NewrM1j5G1KZMBfzyjiDvuU+1NNS1jLhYzoTPuq5/2jfodErnDhCaTE7chINLD6K8h6UgQf4pEKe1Ya9zd0W/N4AyGWzAj87mN5NXMolV+JUj2ndw47o42xW6nQZKpex/SFygfG84prUy1S3UU7t6DapK4xPgcZ2ntY5/5FgUA5RKHdwmlrMr5SodYolRSUlIZ+gJ8HIWSh4IpIJGzoT9Iz5+rweYiG4VOyx9nOMVvjMEin0M713/dYqPS3NyQsAR+n7us7P9yBQlpi86psQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ecQUztVbB+tZgWjwZfMHkpjRZRsON943S3c0L1Qe/eA=; b=amtIiT91//D2qgmEIm0is9nX51cvFJMHWzcvyCT8TM2YSIN9yve6AQyCNCKGcCgx4XrDRneqxI4WKjCjblFHhXZWPyLdQD+LMLKBVCk/z1HdAWC8xZ/Fw4D+r/bZCaozXNeh3W9i0lG2hNPbOIIbEoCromuk+Yjn7L4DJ5nGMGw= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB5279.eurprd04.prod.outlook.com (2603:10a6:803:62::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Sun, 21 Jun 2020 09:52:47 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::d4d6:f65d:34cd:aa43]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::d4d6:f65d:34cd:aa43%3]) with mapi id 15.20.3109.025; Sun, 21 Jun 2020 09:52:46 +0000 To: jerinj@marvell.com, dev@dpdk.org, Hemant Agrawal References: <20200617063047.1555518-1-jerinj@marvell.com> <20200617063047.1555518-12-jerinj@marvell.com> From: "Sachin Saxena (OSS)" Message-ID: Date: Sun, 21 Jun 2020 15:22:39 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 In-Reply-To: <20200617063047.1555518-12-jerinj@marvell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: SG2PR06CA0142.apcprd06.prod.outlook.com (2603:1096:1:1f::20) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.10] (223.190.62.152) by SG2PR06CA0142.apcprd06.prod.outlook.com (2603:1096:1:1f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Sun, 21 Jun 2020 09:52:45 +0000 X-Originating-IP: [223.190.62.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2aec2514-cc46-41c5-12dd-08d815c8d9c2 X-MS-TrafficTypeDiagnostic: VI1PR04MB5279: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 04410E544A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NmDvvqLVYxYN8OoWoFaPAZ77jnm7kYXYa4rb2lDABM8gONqnbYLP528OHFXnrBAJ+a/5oWjQbUfY6xi6SXX42sdXGB4NBhxwHq4/LkUAV3nIEmjUiP8ND8PniuNWyMxB/WXXkuLzOjrqR8fN+qc8PNJ2x4uPoI0sefiqYtaZmGDPiwKdB+gLvIeSa3uUeEwGv8JlI8lW5eBJEqXdfsV+F7YTiywYKt+BJnV9CGmR8BbVn0cGbf+qVIa4lNU+l3EbNd84Rp2IvGQXhpzadi4RUjdzOb5LC1z0DOa6QgphhPUfVhsu0uUXnc6LhAXYlZCU5nqbYzdcn9iWw2GjasQXQa2aag0vV1JqcpstmZPG4L53fmuH5fqKTISs28L1uT/9 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(39850400004)(366004)(346002)(376002)(16526019)(956004)(6666004)(66476007)(66946007)(316002)(6486002)(31686004)(2616005)(66556008)(86362001)(31696002)(8676002)(53546011)(52116002)(83380400001)(16576012)(26005)(6862004)(186003)(478600001)(5660300002)(2906002)(8936002)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: YP/bXjsaf93MH6exbjD8RDpNGSbA0W/uQgDJuP4L89yHFXDF9VZCgZzTqR9DNhLEzOrE3hFx9KMlqy0JTS8J7pOc0Z6JxjYBjwcOHMxmafHmx91CNiPPkOpdedpeKgIKfTxdjrwFaKQ8yJV+knSORnezDVK79B+tpO7IqRS3vhsJWz2GGiAMpQJ7ZIvEN9EpcUpy4pjgHlOWqC7NZOWUz8Ul2U1THvl2TwmPdg7a8OmcDRfIPe7ppxnPegOYtciw+4Z3yTQQLifqtVug/yXPHIkTufCG6jz70buElLVQjHGN7swbKAaF+5RbUnsUYKAYytmB8by8/4A3EELBpWiBL6iEEF1ilGrfDeizz555Vq9un45GK7hC8g3I8hK80oO6Uh2G0JirKktzWNW0P2fCyEuAk0eXpEYtAX+qbkbE8Kab2+lr8SFtfIccP77zxHdHrK61LjF9mtNZHXHlNEou49GAYJoT+p+mejojkIOxUadGC+DPkVyRTg6OoslQQv1H X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2aec2514-cc46-41c5-12dd-08d815c8d9c2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2020 09:52:46.8539 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OQJUEGdRoqw4gy4vsPfkY/o0eDJC4SKFtqMIY2t/DKv9iDzTfWq05AnI/C6Tqqe0q7XpZFc4AKJ/bwJoNcLhEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5279 Subject: Re: [dpdk-dev] [PATCH 11/13] drivers/bus: 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" Acked-by: Sachin Saxena On 17-Jun-20 12:00 PM, jerinj@marvell.com wrote: > From: Jerin Jacob > > Use log register macro to avoid the code duplication > in the log registration process. > > Signed-off-by: Jerin Jacob > --- > drivers/bus/dpaa/dpaa_bus.c | 10 +--------- > drivers/bus/fslmc/fslmc_bus.c | 11 +---------- > drivers/bus/ifpga/ifpga_bus.c | 9 +-------- > drivers/bus/vdev/vdev.c | 10 +--------- > drivers/bus/vmbus/vmbus_common.c | 9 +-------- > 5 files changed, 5 insertions(+), 44 deletions(-) > > diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c > index d53fe6083..0d8b13e5f 100644 > --- a/drivers/bus/dpaa/dpaa_bus.c > +++ b/drivers/bus/dpaa/dpaa_bus.c > @@ -42,8 +42,6 @@ > #include > #include > > -int dpaa_logtype_bus; > - > static struct rte_dpaa_bus rte_dpaa_bus; > struct netcfg_info *dpaa_netcfg; > > @@ -749,10 +747,4 @@ static struct rte_dpaa_bus rte_dpaa_bus = { > }; > > RTE_REGISTER_BUS(FSL_DPAA_BUS_NAME, rte_dpaa_bus.bus); > - > -RTE_INIT(dpaa_init_log) > -{ > - dpaa_logtype_bus = rte_log_register("bus.dpaa"); > - if (dpaa_logtype_bus >= 0) > - rte_log_set_level(dpaa_logtype_bus, RTE_LOG_NOTICE); > -} > +RTE_LOG_REGISTER(dpaa_logtype_bus, bus.dpaa, NOTICE); > diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c > index afbd82e8d..d9f403bd9 100644 > --- a/drivers/bus/fslmc/fslmc_bus.c > +++ b/drivers/bus/fslmc/fslmc_bus.c > @@ -21,8 +21,6 @@ > > #include > > -int dpaa2_logtype_bus; > - > #define VFIO_IOMMU_GROUP_PATH "/sys/kernel/iommu_groups" > #define FSLMC_BUS_NAME fslmc > > @@ -649,11 +647,4 @@ struct rte_fslmc_bus rte_fslmc_bus = { > }; > > RTE_REGISTER_BUS(FSLMC_BUS_NAME, rte_fslmc_bus.bus); > - > -RTE_INIT(fslmc_init_log) > -{ > - /* Bus level logs */ > - dpaa2_logtype_bus = rte_log_register("bus.fslmc"); > - if (dpaa2_logtype_bus >= 0) > - rte_log_set_level(dpaa2_logtype_bus, RTE_LOG_NOTICE); > -} > +RTE_LOG_REGISTER(dpaa2_logtype_bus, bus.fslmc, NOTICE); > diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c > index addbc3e86..103915d43 100644 > --- a/drivers/bus/ifpga/ifpga_bus.c > +++ b/drivers/bus/ifpga/ifpga_bus.c > @@ -32,7 +32,6 @@ > #include "ifpga_logs.h" > #include "ifpga_common.h" > > -int ifpga_bus_logtype; > > /* Forward declaration to access Intel FPGA bus > * on which iFPGA devices are connected > @@ -474,10 +473,4 @@ static struct rte_bus rte_ifpga_bus = { > }; > > RTE_REGISTER_BUS(IFPGA_BUS_NAME, rte_ifpga_bus); > - > -RTE_INIT(ifpga_init_log) > -{ > - ifpga_bus_logtype = rte_log_register("bus.ifpga"); > - if (ifpga_bus_logtype >= 0) > - rte_log_set_level(ifpga_bus_logtype, RTE_LOG_NOTICE); > -} > +RTE_LOG_REGISTER(ifpga_bus_logtype, bus.ifpga, NOTICE); > diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c > index a89ea2353..d746149a2 100644 > --- a/drivers/bus/vdev/vdev.c > +++ b/drivers/bus/vdev/vdev.c > @@ -27,8 +27,6 @@ > > #define VDEV_MP_KEY "bus_vdev_mp" > > -int vdev_logtype_bus; > - > /* Forward declare to access virtual bus name */ > static struct rte_bus rte_vdev_bus; > > @@ -557,10 +555,4 @@ static struct rte_bus rte_vdev_bus = { > }; > > RTE_REGISTER_BUS(vdev, rte_vdev_bus); > - > -RTE_INIT(vdev_init_log) > -{ > - vdev_logtype_bus = rte_log_register("bus.vdev"); > - if (vdev_logtype_bus >= 0) > - rte_log_set_level(vdev_logtype_bus, RTE_LOG_NOTICE); > -} > +RTE_LOG_REGISTER(vdev_logtype_bus, bus.vdev, NOTICE); > diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c > index 3adef01c9..4c9ac33ac 100644 > --- a/drivers/bus/vmbus/vmbus_common.c > +++ b/drivers/bus/vmbus/vmbus_common.c > @@ -22,7 +22,6 @@ > > #include "private.h" > > -int vmbus_logtype_bus; > extern struct rte_vmbus_bus rte_vmbus_bus; > > /* map a particular resource from a file */ > @@ -298,10 +297,4 @@ struct rte_vmbus_bus rte_vmbus_bus = { > }; > > RTE_REGISTER_BUS(vmbus, rte_vmbus_bus.bus); > - > -RTE_INIT(vmbus_init_log) > -{ > - vmbus_logtype_bus = rte_log_register("bus.vmbus"); > - if (vmbus_logtype_bus >= 0) > - rte_log_set_level(vmbus_logtype_bus, RTE_LOG_NOTICE); > -} > +RTE_LOG_REGISTER(vmbus_logtype_bus, bus.vmbus, NOTICE);