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 178C3A09EA; Wed, 9 Dec 2020 14:05:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0C481BE79; Wed, 9 Dec 2020 14:05:00 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 81E15BE73 for ; Wed, 9 Dec 2020 14:04:57 +0100 (CET) IronPort-SDR: aUzBJGZ8S9xGNJJriAkQ5bKhP/4qfCLCcxstkHS3XhekmCLC1E+X8H4hmizhbNasWvVgntoh0i p6AWTg00CUsQ== X-IronPort-AV: E=McAfee;i="6000,8403,9829"; a="161832408" X-IronPort-AV: E=Sophos;i="5.78,405,1599548400"; d="scan'208";a="161832408" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2020 05:04:55 -0800 IronPort-SDR: O+08Lq++GVVBpgkXAik2l72RCTETt2vb3l23dO9V3A92Jl2v35ThdO+1NoaMPC25zGxsmZBGyo BsY6UotzRH9A== X-IronPort-AV: E=Sophos;i="5.78,405,1599548400"; d="scan'208";a="437781813" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.215.89]) ([10.213.215.89]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2020 05:04:54 -0800 To: Andrew Boyer , dev@dpdk.org Cc: Alfredo Cardigliano References: <20201203203418.15064-1-aboyer@pensando.io> <20201204201646.51746-9-aboyer@pensando.io> From: Ferruh Yigit Message-ID: <4a267033-5b25-24a5-cd47-f32535789c0d@intel.com> Date: Wed, 9 Dec 2020 13:04:50 +0000 MIME-Version: 1.0 In-Reply-To: <20201204201646.51746-9-aboyer@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/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?