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 76449A04E6 for ; Wed, 18 Nov 2020 11:46:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C3479C8BC; Wed, 18 Nov 2020 11:46:55 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 84EFF5947; Wed, 18 Nov 2020 11:46:48 +0100 (CET) IronPort-SDR: pBmhshGEyORjfZgF16U2bsoOALKEDeyO9S9VkEjNCdEjnvwDKSNwdNpJSKs9I9hVja6Dx0uGli +R0Hlds5xD2g== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="255808256" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="255808256" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 02:46:47 -0800 IronPort-SDR: KJaE+mvKK3Sm4+wZWpI3KuzngGGG/9deYgKrcpm9zZ8nfRdszmdWNfaVLQguYbfJH1GfHvUvbj QIZAIMZ0cbjw== X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="544459983" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.244.64]) ([10.213.244.64]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 02:46:45 -0800 To: "Varghese, Vipin" , "Tahhan, Maryam" , "Pattan, Reshma" , "Mcnamara, John" Cc: "dev@dpdk.org" , "stable@dpdk.org" References: <20201117171435.2303641-1-ferruh.yigit@intel.com> <20201117171435.2303641-5-ferruh.yigit@intel.com> From: Ferruh Yigit Message-ID: <3282f07d-dcf6-4d8b-b8a8-8caf14dbb492@intel.com> Date: Wed, 18 Nov 2020 10:46:42 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [PATCH 4/4] app/procinfo: remove useless assignment X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 11/17/2020 6:04 PM, Varghese, Vipin wrote: > Hi Ferruh, > > Thanks for the update > > snipped >> show_mempool(char *name) { >> -uint64_t flags = 0; >> +uint64_t flags; >> > > Checking the current code base it makes more sense to move the code inside `if` condition check. Sample code shared below > > ``` > -uint64_t flags = 0; > > snprintf(bdr_str, MAX_STRING_LEN, " show - MEMPOOL "); > STATS_BDR_STR(10, bdr_str); > > if (name != NULL) { > struct rte_mempool *ptr = rte_mempool_lookup(name); > if (ptr != NULL) { > struct rte_mempool_ops *ops; > > +unsigned int flags = ptr->flags; > ops = rte_mempool_get_ops(ptr->ops_index); > ``` > > But it is ok > I think both are OK, this is trivial, let me send a quick v2.