i40e: don't degrade __le16
authorMitch Williams <mitch.a.williams@intel.com>
Fri, 10 Jul 2015 23:35:56 +0000 (19:35 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 26 Aug 2015 21:44:38 +0000 (14:44 -0700)
Sparse cries when we compare an __le16 to a u16, almost like it cares
about architectures other than x86. Weird. Use the le16_to_cpu macro to
make it stop crying.

Change-ID: Id068f4d7868a2d3df234a791a76d15938f37db35
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

index 3bb832a2ec51a6997a7fab7d832176ce9a606977..ded62eb3204fc7efd1121cd6a3305572333708df 100644 (file)
@@ -1255,6 +1255,8 @@ struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr,
        struct i40e_mac_filter *f;
 
        list_for_each_entry(f, &vsi->mac_filter_list, list) {
+               if (vsi->info.pvid)
+                       f->vlan = le16_to_cpu(vsi->info.pvid);
                if (!i40e_find_filter(vsi, macaddr, f->vlan,
                                      is_vf, is_netdev)) {
                        if (!i40e_add_filter(vsi, macaddr, f->vlan,
index 8a7607c6e142d05b247ff7b948e9c6599c22a91c..70a6fb14f6dea8f24b2ae29ecf57e5f87c49a800 100644 (file)
@@ -2106,11 +2106,12 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
                goto error_pvid;
        }
 
-       if (vsi->info.pvid == (vlan_id | (qos << I40E_VLAN_PRIORITY_SHIFT)))
+       if (le16_to_cpu(vsi->info.pvid) ==
+           (vlan_id | (qos << I40E_VLAN_PRIORITY_SHIFT)))
                /* duplicate request, so just return success */
                goto error_pvid;
 
-       if (vsi->info.pvid == 0 && i40e_is_vsi_in_vlan(vsi)) {
+       if (le16_to_cpu(vsi->info.pvid) == 0 && i40e_is_vsi_in_vlan(vsi)) {
                dev_err(&pf->pdev->dev,
                        "VF %d has already configured VLAN filters and the administrator is requesting a port VLAN override.\nPlease unload and reload the VF driver for this change to take effect.\n",
                        vf_id);