提交 0266ac45 编写于 作者: K Keller, Jacob E 提交者: David S. Miller

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: NJacob Keller <jacob.e.keller@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Bimmy Pujari <bimmy.pujari@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6246168b
...@@ -2196,8 +2196,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) ...@@ -2196,8 +2196,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
} }
add_list[num_add].queue_number = 0; add_list[num_add].queue_number = 0;
/* set invalid match method for later detection */ /* set invalid match method for later detection */
add_list[num_add].match_method = add_list[num_add].match_method = I40E_AQC_MM_ERR_NO_RES;
cpu_to_le16((u16)I40E_AQC_MM_ERR_NO_RES);
cmd_flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH; cmd_flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH;
add_list[num_add].flags = cpu_to_le16(cmd_flags); add_list[num_add].flags = cpu_to_le16(cmd_flags);
num_add++; num_add++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册