aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igb/igb_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <aduyck@mirantis.com>2016-03-18 19:06:53 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-04-06 15:16:07 -0400
commit415cd2a645b2573f173cc52419049f9caacf9a47 (patch)
tree180971ffb1d7a36b01c6df58603987fc30335633 /drivers/net/ethernet/intel/igb/igb_main.c
parent4da46cebbd3b4dc445195a9672c99c1353af5695 (diff)
igb: Fix sparse warning about passing __beXX into leXX_to_cpup
We were casting the addr as __beXX and then passing it into le32_to_cpu because the device expects the MAC address to be in network order even though the register set is little endian. Instead of casting it as __beXX we can just cast it as __leXX in order to maintain consistency since the region of memory is already in little endian order as far as we are concerned. Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_main.c')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 55a1405cb2a1..36814a2e326d 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7845,11 +7845,13 @@ static void igb_rar_set_qsel(struct igb_adapter *adapter, u8 *addr, u32 index,
7845 struct e1000_hw *hw = &adapter->hw; 7845 struct e1000_hw *hw = &adapter->hw;
7846 u32 rar_low, rar_high; 7846 u32 rar_low, rar_high;
7847 7847
7848 /* HW expects these in little endian so we reverse the byte order 7848 /* HW expects these to be in network order when they are plugged
7849 * from network order (big endian) to CPU endian 7849 * into the registers which are little endian. In order to guarantee
7850 * that ordering we need to do an leXX_to_cpup here in order to be
7851 * ready for the byteswap that occurs with writel
7850 */ 7852 */
7851 rar_low = le32_to_cpup((__be32 *)(addr)); 7853 rar_low = le32_to_cpup((__le32 *)(addr));
7852 rar_high = le16_to_cpup((__be16 *)(addr + 4)); 7854 rar_high = le16_to_cpup((__le16 *)(addr + 4));
7853 7855
7854 /* Indicate to hardware the Address is Valid. */ 7856 /* Indicate to hardware the Address is Valid. */
7855 rar_high |= E1000_RAH_AV; 7857 rar_high |= E1000_RAH_AV;