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 CE178A04E6; Wed, 9 Dec 2020 16:26:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACEFEBE79; Wed, 9 Dec 2020 16:26:03 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 00040BE75 for ; Wed, 9 Dec 2020 16:26:01 +0100 (CET) IronPort-SDR: YcEMs3ad5znyTqUCyA2ohpdajp2Em3od62xG/WjlCx+01wkcOO7vPCwPgQfqNeieucj/h/kAD3 XRESxa2lNYUw== X-IronPort-AV: E=McAfee;i="6000,8403,9829"; a="174237478" X-IronPort-AV: E=Sophos;i="5.78,405,1599548400"; d="scan'208";a="174237478" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2020 07:26:00 -0800 IronPort-SDR: VvjDAyVeEhqtQFGehovOfLYn2D9oOEZaQ2P/TjjiMzQ/qXWGBkrAqnWmoVRVSe00uje5z+DIR4 Kj6/Hd2+sXCQ== X-IronPort-AV: E=Sophos;i="5.78,405,1599548400"; d="scan'208";a="318324556" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.215.89]) ([10.213.215.89]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2020 07:25:58 -0800 To: Andrew Boyer Cc: dev@dpdk.org, Alfredo Cardigliano References: <20201203203418.15064-1-aboyer@pensando.io> <20201204201646.51746-9-aboyer@pensando.io> <4a267033-5b25-24a5-cd47-f32535789c0d@intel.com> <6E19F2FB-407A-4656-B0E6-25D38BC5A873@pensando.io> From: Ferruh Yigit Message-ID: <9ad5eda4-d0b6-a377-ced8-d82b4e6e9fd3@intel.com> Date: Wed, 9 Dec 2020 15:25:56 +0000 MIME-Version: 1.0 In-Reply-To: <6E19F2FB-407A-4656-B0E6-25D38BC5A873@pensando.io> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 8/9] net/ionic: minor refactorings and helper variables 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" On 12/9/2020 2:39 PM, Andrew Boyer wrote: > > >> On Dec 9, 2020, at 8:04 AM, Ferruh Yigit > > wrote: >> >> On 12/4/2020 8:16 PM, Andrew Boyer wrote: >>> This makes the code clearer and conserves resources. >>> Signed-off-by: Andrew Boyer > >>> --- >>>  drivers/net/ionic/ionic_ethdev.c |  5 ++--- >>>  drivers/net/ionic/ionic_lif.c    | 15 ++++++++++----- >>>  drivers/net/ionic/ionic_main.c   | 18 +++++++----------- >>>  3 files changed, 19 insertions(+), 19 deletions(-) >>> diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c >>> index ce6ca9671..a1c35ace3 100644 >>> --- a/drivers/net/ionic/ionic_ethdev.c >>> +++ b/drivers/net/ionic/ionic_ethdev.c >>> @@ -901,7 +901,7 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) >>> struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev); >>> struct ionic_adapter *adapter = lif->adapter; >>> struct ionic_dev *idev = &adapter->idev; >>> -uint32_t allowed_speeds; >>> +uint32_t speed, allowed_speeds; >>> int err; >>> IONIC_PRINT_CALL(); >>> @@ -929,8 +929,7 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) >>> } >>> if (eth_dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { >>> -uint32_t speed = ionic_parse_link_speeds(dev_conf->link_speeds); >>> - >>> +speed = ionic_parse_link_speeds(dev_conf->link_speeds); >>> if (speed) >>> ionic_dev_cmd_port_speed(idev, speed); >>> } >> >> Same comment from previous version, what is the reason to increase the scope >> of the 'speed' variable? >> Functionality is same and isn't it better to have reduced scope? > > In a future patch I will be redesigning this code block and speed will have > function scope. > > I have tried to break things up into digestible bits. Is this not acceptable? > On its own this is not a good change, please do the update in the future patch.