net/ice/base: reduce scope of variables
authorQi Zhang <qi.z.zhang@intel.com>
Mon, 30 Mar 2020 11:45:24 +0000 (19:45 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:05 +0000 (13:57 +0200)
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 <anthony.l.nguyen@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_common.c
drivers/net/ice/base/ice_fdir.c

index 0cf578c..1acac86 100644 (file)
@@ -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",
index 6dc8d54..df754dc 100644 (file)
@@ -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;
 }
 
 /**