]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: don't truncate match_method assignment
authorKeller, Jacob E <jacob.e.keller@intel.com>
Fri, 9 Dec 2016 21:39:21 +0000 (13:39 -0800)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:41:57 +0000 (19:41 -0500)
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 <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>
(cherry picked from commit 0266ac4536cdbf37e0bed918b97b6763aa8b84e2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 8ae30bc2362ca96f4de52a97dac493081dc0627d..614128766b350d3c00a154d7afc105b03734f3bc 100644 (file)
@@ -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++;