Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice: use variable name more descriptive than type

The variable name 'type' is not very descriptive. Replace instances of
those with a variable name that is more descriptive or replace it if not
needed.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Bruce Allan and committed by
Jeff Kirsher
6dae8aa0 dced8ad3

+36 -36
+8 -8
drivers/net/ethernet/intel/ice/ice_dcb_lib.c
··· 779 779 bool need_reconfig = false; 780 780 struct ice_port_info *pi; 781 781 struct ice_vsi *pf_vsi; 782 - u8 type; 782 + u8 mib_type; 783 783 int ret; 784 784 785 785 /* Not DCB capable or capability disabled */ ··· 794 794 pi = pf->hw.port_info; 795 795 mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw; 796 796 /* Ignore if event is not for Nearest Bridge */ 797 - type = ((mib->type >> ICE_AQ_LLDP_BRID_TYPE_S) & 798 - ICE_AQ_LLDP_BRID_TYPE_M); 799 - dev_dbg(dev, "LLDP event MIB bridge type 0x%x\n", type); 800 - if (type != ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID) 797 + mib_type = ((mib->type >> ICE_AQ_LLDP_BRID_TYPE_S) & 798 + ICE_AQ_LLDP_BRID_TYPE_M); 799 + dev_dbg(dev, "LLDP event MIB bridge type 0x%x\n", mib_type); 800 + if (mib_type != ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID) 801 801 return; 802 802 803 803 /* Check MIB Type and return if event for Remote MIB update */ 804 - type = mib->type & ICE_AQ_LLDP_MIB_TYPE_M; 805 - dev_dbg(dev, "LLDP event mib type %s\n", type ? "remote" : "local"); 806 - if (type == ICE_AQ_LLDP_MIB_REMOTE) { 804 + mib_type = mib->type & ICE_AQ_LLDP_MIB_TYPE_M; 805 + dev_dbg(dev, "LLDP event mib type %s\n", mib_type ? "remote" : "local"); 806 + if (mib_type == ICE_AQ_LLDP_MIB_REMOTE) { 807 807 /* Update the remote cached instance and return */ 808 808 ret = ice_aq_get_dcb_cfg(pi->hw, ICE_AQ_LLDP_MIB_REMOTE, 809 809 ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID,
+4 -4
drivers/net/ethernet/intel/ice/ice_flow.c
··· 694 694 * ice_flow_set_fld_ext - specifies locations of field from entry's input buffer 695 695 * @seg: packet segment the field being set belongs to 696 696 * @fld: field to be set 697 - * @type: type of the field 697 + * @field_type: type of the field 698 698 * @val_loc: if not ICE_FLOW_FLD_OFF_INVAL, location of the value to match from 699 699 * entry's input buffer 700 700 * @mask_loc: if not ICE_FLOW_FLD_OFF_INVAL, location of mask value from entry's ··· 715 715 */ 716 716 static void 717 717 ice_flow_set_fld_ext(struct ice_flow_seg_info *seg, enum ice_flow_field fld, 718 - enum ice_flow_fld_match_type type, u16 val_loc, 718 + enum ice_flow_fld_match_type field_type, u16 val_loc, 719 719 u16 mask_loc, u16 last_loc) 720 720 { 721 721 u64 bit = BIT_ULL(fld); 722 722 723 723 seg->match |= bit; 724 - if (type == ICE_FLOW_FLD_TYPE_RANGE) 724 + if (field_type == ICE_FLOW_FLD_TYPE_RANGE) 725 725 seg->range |= bit; 726 726 727 - seg->fields[fld].type = type; 727 + seg->fields[fld].type = field_type; 728 728 seg->fields[fld].src.val = val_loc; 729 729 seg->fields[fld].src.mask = mask_loc; 730 730 seg->fields[fld].src.last = last_loc;
+12 -12
drivers/net/ethernet/intel/ice/ice_lib.c
··· 9 9 10 10 /** 11 11 * ice_vsi_type_str - maps VSI type enum to string equivalents 12 - * @type: VSI type enum 12 + * @vsi_type: VSI type enum 13 13 */ 14 - const char *ice_vsi_type_str(enum ice_vsi_type type) 14 + const char *ice_vsi_type_str(enum ice_vsi_type vsi_type) 15 15 { 16 - switch (type) { 16 + switch (vsi_type) { 17 17 case ICE_VSI_PF: 18 18 return "ICE_VSI_PF"; 19 19 case ICE_VSI_VF: ··· 350 350 /** 351 351 * ice_vsi_alloc - Allocates the next available struct VSI in the PF 352 352 * @pf: board private structure 353 - * @type: type of VSI 353 + * @vsi_type: type of VSI 354 354 * @vf_id: ID of the VF being configured 355 355 * 356 356 * returns a pointer to a VSI on success, NULL on failure. 357 357 */ 358 358 static struct ice_vsi * 359 - ice_vsi_alloc(struct ice_pf *pf, enum ice_vsi_type type, u16 vf_id) 359 + ice_vsi_alloc(struct ice_pf *pf, enum ice_vsi_type vsi_type, u16 vf_id) 360 360 { 361 361 struct device *dev = ice_pf_to_dev(pf); 362 362 struct ice_vsi *vsi = NULL; ··· 377 377 if (!vsi) 378 378 goto unlock_pf; 379 379 380 - vsi->type = type; 380 + vsi->type = vsi_type; 381 381 vsi->back = pf; 382 382 set_bit(__ICE_DOWN, vsi->state); 383 383 384 384 vsi->idx = pf->next_vsi; 385 385 386 - if (type == ICE_VSI_VF) 386 + if (vsi_type == ICE_VSI_VF) 387 387 ice_vsi_set_num_qs(vsi, vf_id); 388 388 else 389 389 ice_vsi_set_num_qs(vsi, ICE_INVAL_VFID); ··· 2084 2084 * ice_vsi_setup - Set up a VSI by a given type 2085 2085 * @pf: board private structure 2086 2086 * @pi: pointer to the port_info instance 2087 - * @type: VSI type 2087 + * @vsi_type: VSI type 2088 2088 * @vf_id: defines VF ID to which this VSI connects. This field is meant to be 2089 2089 * used only for ICE_VSI_VF VSI type. For other VSI types, should 2090 2090 * fill-in ICE_INVAL_VFID as input. ··· 2096 2096 */ 2097 2097 struct ice_vsi * 2098 2098 ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi, 2099 - enum ice_vsi_type type, u16 vf_id) 2099 + enum ice_vsi_type vsi_type, u16 vf_id) 2100 2100 { 2101 2101 u16 max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 }; 2102 2102 struct device *dev = ice_pf_to_dev(pf); ··· 2104 2104 struct ice_vsi *vsi; 2105 2105 int ret, i; 2106 2106 2107 - if (type == ICE_VSI_VF) 2108 - vsi = ice_vsi_alloc(pf, type, vf_id); 2107 + if (vsi_type == ICE_VSI_VF) 2108 + vsi = ice_vsi_alloc(pf, vsi_type, vf_id); 2109 2109 else 2110 - vsi = ice_vsi_alloc(pf, type, ICE_INVAL_VFID); 2110 + vsi = ice_vsi_alloc(pf, vsi_type, ICE_INVAL_VFID); 2111 2111 2112 2112 if (!vsi) { 2113 2113 dev_err(dev, "could not allocate VSI\n");
+2 -2
drivers/net/ethernet/intel/ice/ice_lib.h
··· 6 6 7 7 #include "ice.h" 8 8 9 - const char *ice_vsi_type_str(enum ice_vsi_type type); 9 + const char *ice_vsi_type_str(enum ice_vsi_type vsi_type); 10 10 11 11 int 12 12 ice_add_mac_to_list(struct ice_vsi *vsi, struct list_head *add_list, ··· 58 58 59 59 struct ice_vsi * 60 60 ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi, 61 - enum ice_vsi_type type, u16 vf_id); 61 + enum ice_vsi_type vsi_type, u16 vf_id); 62 62 63 63 void ice_napi_del(struct ice_vsi *vsi); 64 64
+10 -10
drivers/net/ethernet/intel/ice/ice_switch.c
··· 578 578 struct ice_aqc_get_sw_cfg_resp_elem *ele; 579 579 u16 pf_vf_num, swid, vsi_port_num; 580 580 bool is_vf = false; 581 - u8 type; 581 + u8 res_type; 582 582 583 583 ele = rbuf[i].elements; 584 584 vsi_port_num = le16_to_cpu(ele->vsi_port_num) & ··· 593 593 ICE_AQC_GET_SW_CONF_RESP_IS_VF) 594 594 is_vf = true; 595 595 596 - type = le16_to_cpu(ele->vsi_port_num) >> 596 + res_type = le16_to_cpu(ele->vsi_port_num) >> 597 597 ICE_AQC_GET_SW_CONF_RESP_TYPE_S; 598 598 599 - if (type == ICE_AQC_GET_SW_CONF_RESP_VSI) { 599 + if (res_type == ICE_AQC_GET_SW_CONF_RESP_VSI) { 600 600 /* FW VSI is not needed. Just continue. */ 601 601 continue; 602 602 } 603 603 604 604 ice_init_port_info(hw->port_info, vsi_port_num, 605 - type, swid, pf_vf_num, is_vf); 605 + res_type, swid, pf_vf_num, is_vf); 606 606 } 607 607 } while (req_desc && !status); 608 608 ··· 958 958 struct ice_aqc_sw_rules_elem *s_rule; 959 959 enum ice_status status; 960 960 u16 s_rule_size; 961 - u16 type; 961 + u16 rule_type; 962 962 int i; 963 963 964 964 if (!num_vsi) ··· 970 970 lkup_type == ICE_SW_LKUP_ETHERTYPE_MAC || 971 971 lkup_type == ICE_SW_LKUP_PROMISC || 972 972 lkup_type == ICE_SW_LKUP_PROMISC_VLAN) 973 - type = remove ? ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR : 974 - ICE_AQC_SW_RULES_T_VSI_LIST_SET; 973 + rule_type = remove ? ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR : 974 + ICE_AQC_SW_RULES_T_VSI_LIST_SET; 975 975 else if (lkup_type == ICE_SW_LKUP_VLAN) 976 - type = remove ? ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR : 977 - ICE_AQC_SW_RULES_T_PRUNE_LIST_SET; 976 + rule_type = remove ? ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR : 977 + ICE_AQC_SW_RULES_T_PRUNE_LIST_SET; 978 978 else 979 979 return ICE_ERR_PARAM; 980 980 ··· 992 992 cpu_to_le16(ice_get_hw_vsi_num(hw, vsi_handle_arr[i])); 993 993 } 994 994 995 - s_rule->type = cpu_to_le16(type); 995 + s_rule->type = cpu_to_le16(rule_type); 996 996 s_rule->pdata.vsi_list.number_vsi = cpu_to_le16(num_vsi); 997 997 s_rule->pdata.vsi_list.index = cpu_to_le16(vsi_list_id); 998 998