aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e/i40e_main.c
diff options
context:
space:
mode:
authorKeller, Jacob E <jacob.e.keller@intel.com>2016-12-09 13:39:21 -0800
committerDavid S. Miller <davem@davemloft.net>2016-12-10 23:31:19 -0500
commit0266ac4536cdbf37e0bed918b97b6763aa8b84e2 (patch)
tree75cd1fbc3b65ed3bf4537841e1f96358cb876f5a /drivers/net/ethernet/intel/i40e/i40e_main.c
parentnet: ethernet: ti: netcp: add support of cpts (diff)
downloadlinux-dev-0266ac4536cdbf37e0bed918b97b6763aa8b84e2.tar.xz
linux-dev-0266ac4536cdbf37e0bed918b97b6763aa8b84e2.zip
i40e: don't truncate match_method assignment
The .match_method field is a u8, so we shouldn't be casting to a u16, and because it is only one byte, we do not need to byte swap anything. Just assign the value directly. This avoids issues on Big Endian architectures which would have byte swapped and then incorrectly truncated the value. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Bimmy Pujari <bimmy.pujari@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index da4cbe32eb86..ad4cf639430e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2196,8 +2196,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
}
add_list[num_add].queue_number = 0;
/* set invalid match method for later detection */
- add_list[num_add].match_method =
- cpu_to_le16((u16)I40E_AQC_MM_ERR_NO_RES);
+ add_list[num_add].match_method = I40E_AQC_MM_ERR_NO_RES;
cmd_flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH;
add_list[num_add].flags = cpu_to_le16(cmd_flags);
num_add++;