Commit feee3cb3 authored by Bruce Allan's avatar Bruce Allan Committed by Jeff Kirsher

ice: Silence semantic parser warnings

Recent versions of sparse warn about casting pointers to/from restricted
endian types in the Linux driver.  Silence those with the compiler
attribute __force macro from the Linux kernel to force casts to/from
restricted endian types.
Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent aa6ccf3f
...@@ -119,7 +119,7 @@ ice_read_sr_word_aq(struct ice_hw *hw, u16 offset, u16 *data) ...@@ -119,7 +119,7 @@ ice_read_sr_word_aq(struct ice_hw *hw, u16 offset, u16 *data)
status = ice_read_sr_aq(hw, offset, 1, data, true); status = ice_read_sr_aq(hw, offset, 1, data, true);
if (!status) if (!status)
*data = le16_to_cpu(*(__le16 *)data); *data = le16_to_cpu(*(__force __le16 *)data);
return status; return status;
} }
...@@ -174,7 +174,7 @@ ice_read_sr_buf_aq(struct ice_hw *hw, u16 offset, u16 *words, u16 *data) ...@@ -174,7 +174,7 @@ ice_read_sr_buf_aq(struct ice_hw *hw, u16 offset, u16 *words, u16 *data)
} while (words_read < *words); } while (words_read < *words);
for (i = 0; i < *words; i++) for (i = 0; i < *words; i++)
data[i] = le16_to_cpu(((__le16 *)data)[i]); data[i] = le16_to_cpu(((__force __le16 *)data)[i]);
read_nvm_buf_aq_exit: read_nvm_buf_aq_exit:
*words = words_read; *words = words_read;
......
...@@ -799,7 +799,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info, ...@@ -799,7 +799,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
daddr = f_info->l_data.ethertype_mac.mac_addr; daddr = f_info->l_data.ethertype_mac.mac_addr;
/* fall-through */ /* fall-through */
case ICE_SW_LKUP_ETHERTYPE: case ICE_SW_LKUP_ETHERTYPE:
off = (__be16 *)(eth_hdr + ICE_ETH_ETHTYPE_OFFSET); off = (__force __be16 *)(eth_hdr + ICE_ETH_ETHTYPE_OFFSET);
*off = cpu_to_be16(f_info->l_data.ethertype_mac.ethertype); *off = cpu_to_be16(f_info->l_data.ethertype_mac.ethertype);
break; break;
case ICE_SW_LKUP_MAC_VLAN: case ICE_SW_LKUP_MAC_VLAN:
...@@ -829,7 +829,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info, ...@@ -829,7 +829,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
ether_addr_copy(eth_hdr + ICE_ETH_DA_OFFSET, daddr); ether_addr_copy(eth_hdr + ICE_ETH_DA_OFFSET, daddr);
if (!(vlan_id > ICE_MAX_VLAN_ID)) { if (!(vlan_id > ICE_MAX_VLAN_ID)) {
off = (__be16 *)(eth_hdr + ICE_ETH_VLAN_TCI_OFFSET); off = (__force __be16 *)(eth_hdr + ICE_ETH_VLAN_TCI_OFFSET);
*off = cpu_to_be16(vlan_id); *off = cpu_to_be16(vlan_id);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment