From: Keller, Jacob E Date: Fri, 9 Dec 2016 21:39:21 +0000 (-0800) Subject: i40e: don't truncate match_method assignment X-Git-Tag: v4.1.12-98.0.20170517_2143~42^2~82 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8b1e262d382eb46ca0785d722e14b964534fe336;p=users%2Fjedix%2Flinux-maple.git i40e: don't truncate match_method assignment Orabug: 24568124 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 Cc: Stephen Rothwell Cc: Bimmy Pujari Signed-off-by: David S. Miller (cherry picked from commit 0266ac4536cdbf37e0bed918b97b6763aa8b84e2) Signed-off-by: Brian Maly Signed-off-by: Dhaval Giani --- diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 8ae30bc2362ca..614128766b350 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -2202,8 +2202,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++;