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 8FDB7A057B; Mon, 30 Mar 2020 13:42:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ADEFA1C05C; Mon, 30 Mar 2020 13:42:16 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6497A1C02D for ; Mon, 30 Mar 2020 13:42:14 +0200 (CEST) IronPort-SDR: N3By7W2EPiZFX9i5aPOoN0xSEHvwZqqoTzNonNgQQLn3M4IgKE8PVzCYFVF7lSzx/2T0ShT7WJ buJUAttA4KKQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 04:42:14 -0700 IronPort-SDR: t/9cn/FB2lWUY/nnswzBqeEkxwDaC6P646M7/oeU1snkXgsBCE5LQ9XV/onKN1bYW80p35Y6z3 mmzLoTAz+pCg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,324,1580803200"; d="scan'208";a="449769839" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by fmsmga006.fm.intel.com with ESMTP; 30 Mar 2020 04:42:12 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: xiaolong.ye@intel.com, dev@dpdk.org, Qi Zhang , Tony Nguyen , Paul M Stillwell Jr Date: Mon, 30 Mar 2020 19:45:24 +0800 Message-Id: <20200330114538.43275-3-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200330114538.43275-1-qi.z.zhang@intel.com> References: <20200330114538.43275-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH 02/16] net/ice/base: reduce scope of 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" The scope of these variables can be reduced, so do so. This also eliminates the need for the extra wrapping/braces. Also, compact a line since it can fit within 80 columns Signed-off-by: Tony Nguyen Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_common.c | 5 +---- drivers/net/ice/base/ice_fdir.c | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 0cf578c34..1acac8640 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -1840,9 +1840,6 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count, caps->msix_vector_first_id); break; case ICE_AQC_CAPS_FD: - { - u32 reg_val, val; - if (dev_p) { dev_p->num_flow_director_fltr = number; ice_debug(hw, ICE_DBG_INIT, @@ -1851,6 +1848,7 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count, dev_p->num_flow_director_fltr); } if (func_p) { + u32 reg_val, val; if (hw->dcf_enabled) break; reg_val = rd32(hw, GLQF_FD_SIZE); @@ -1869,7 +1867,6 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count, prefix, func_p->fd_fltr_best_effort); } break; - } case ICE_AQC_CAPS_MAX_MTU: caps->max_mtu = number; ice_debug(hw, ICE_DBG_INIT, "%s: max_mtu = %d\n", diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c index 6dc8d54da..df754dc74 100644 --- a/drivers/net/ice/base/ice_fdir.c +++ b/drivers/net/ice/base/ice_fdir.c @@ -581,8 +581,7 @@ ice_free_fd_shrd_item(struct ice_hw *hw, u16 cntr_id, u16 num_fltr) */ int ice_get_fdir_cnt_all(struct ice_hw *hw) { - return hw->func_caps.fd_fltr_guar + - hw->func_caps.fd_fltr_best_effort; + return hw->func_caps.fd_fltr_guar + hw->func_caps.fd_fltr_best_effort; } /** -- 2.13.6