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

iavf: delete unused iavf_mac_info fields

'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
'type' is write-only. Delete all three.

The function iavf_set_mac_type that sets 'type' also checks if the PCI
vendor ID is Intel. This is unnecessary. Delete the whole function.

If in the future there's a need for the MAC type (or other PCI
ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
for this purpose.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231018111527.78194-1-mschmidt@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Michal Schmidt and committed by
Paolo Abeni
a0e6323d 878d951c

-51
-32
drivers/net/ethernet/intel/iavf/iavf_common.c
··· 7 7 #include <linux/avf/virtchnl.h> 8 8 9 9 /** 10 - * iavf_set_mac_type - Sets MAC type 11 - * @hw: pointer to the HW structure 12 - * 13 - * This function sets the mac type of the adapter based on the 14 - * vendor ID and device ID stored in the hw structure. 15 - **/ 16 - enum iavf_status iavf_set_mac_type(struct iavf_hw *hw) 17 - { 18 - enum iavf_status status = 0; 19 - 20 - if (hw->vendor_id == PCI_VENDOR_ID_INTEL) { 21 - switch (hw->device_id) { 22 - case IAVF_DEV_ID_X722_VF: 23 - hw->mac.type = IAVF_MAC_X722_VF; 24 - break; 25 - case IAVF_DEV_ID_VF: 26 - case IAVF_DEV_ID_VF_HV: 27 - case IAVF_DEV_ID_ADAPTIVE_VF: 28 - hw->mac.type = IAVF_MAC_VF; 29 - break; 30 - default: 31 - hw->mac.type = IAVF_MAC_GENERIC; 32 - break; 33 - } 34 - } else { 35 - status = IAVF_ERR_DEVICE_NOT_SUPPORTED; 36 - } 37 - 38 - return status; 39 - } 40 - 41 - /** 42 10 * iavf_aq_str - convert AQ err code to a string 43 11 * @hw: pointer to the HW structure 44 12 * @aq_err: the AQ error code to convert
-5
drivers/net/ethernet/intel/iavf/iavf_main.c
··· 2356 2356 /* driver loaded, probe complete */ 2357 2357 adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED; 2358 2358 adapter->flags &= ~IAVF_FLAG_RESET_PENDING; 2359 - status = iavf_set_mac_type(hw); 2360 - if (status) { 2361 - dev_err(&pdev->dev, "Failed to set MAC type (%d)\n", status); 2362 - goto err; 2363 - } 2364 2359 2365 2360 ret = iavf_check_reset_complete(hw); 2366 2361 if (ret) {
-2
drivers/net/ethernet/intel/iavf/iavf_prototype.h
··· 45 45 enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid, 46 46 struct iavf_aqc_get_set_rss_key_data *key); 47 47 48 - enum iavf_status iavf_set_mac_type(struct iavf_hw *hw); 49 - 50 48 extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[]; 51 49 52 50 static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
-12
drivers/net/ethernet/intel/iavf/iavf_type.h
··· 69 69 * the Firmware and AdminQ are intended to insulate the driver from most of the 70 70 * future changes, but these structures will also do part of the job. 71 71 */ 72 - enum iavf_mac_type { 73 - IAVF_MAC_UNKNOWN = 0, 74 - IAVF_MAC_XL710, 75 - IAVF_MAC_VF, 76 - IAVF_MAC_X722, 77 - IAVF_MAC_X722_VF, 78 - IAVF_MAC_GENERIC, 79 - }; 80 - 81 72 enum iavf_vsi_type { 82 73 IAVF_VSI_MAIN = 0, 83 74 IAVF_VSI_VMDQ1 = 1, ··· 101 110 }; 102 111 103 112 struct iavf_mac_info { 104 - enum iavf_mac_type type; 105 113 u8 addr[ETH_ALEN]; 106 114 u8 perm_addr[ETH_ALEN]; 107 - u8 san_addr[ETH_ALEN]; 108 - u16 max_fcoeq; 109 115 }; 110 116 111 117 /* PCI bus types */