]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: stmmac: Fix sparse warning
authorJose Abreu <Jose.Abreu@synopsys.com>
Mon, 11 Nov 2019 14:42:34 +0000 (15:42 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Nov 2019 07:13:19 +0000 (23:13 -0800)
The VID is converted to le16 so the variable must be __le16 type.

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: c7ab0b8088d7 ("net: stmmac: Fallback to VLAN Perfect filtering if HASH is not available")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index a2ecab5dc8c801fc1365b34851e76ee4b7c03a63..40ca00e596dd7c8594c446dd9a53dd412be2200b 100644 (file)
@@ -733,7 +733,7 @@ static void dwmac4_set_mac_loopback(void __iomem *ioaddr, bool enable)
 }
 
 static void dwmac4_update_vlan_hash(struct mac_device_info *hw, u32 hash,
-                                   u16 perfect_match, bool is_double)
+                                   __le16 perfect_match, bool is_double)
 {
        void __iomem *ioaddr = hw->pcsr;
 
index 9553d2bec1a7076c218deb9b7fdb7bee5feb3562..082f5ee9e52566ae06fca10463fe69cd7af37257 100644 (file)
@@ -556,7 +556,7 @@ static int dwxgmac2_rss_configure(struct mac_device_info *hw,
 }
 
 static void dwxgmac2_update_vlan_hash(struct mac_device_info *hw, u32 hash,
-                                     u16 perfect_match, bool is_double)
+                                     __le16 perfect_match, bool is_double)
 {
        void __iomem *ioaddr = hw->pcsr;
 
index 1303d1e9a18f1b6a6efcf11c4f8e5989ebcf7d1f..509daeefdb79cee911b21fbbc355db258f90b1a9 100644 (file)
@@ -357,7 +357,7 @@ struct stmmac_ops {
                             struct stmmac_rss *cfg, u32 num_rxq);
        /* VLAN */
        void (*update_vlan_hash)(struct mac_device_info *hw, u32 hash,
-                                u16 perfect_match, bool is_double);
+                                __le16 perfect_match, bool is_double);
        void (*enable_vlan)(struct mac_device_info *hw, u32 type);
        /* TX Timestamp */
        int (*get_mac_tx_timestamp)(struct mac_device_info *hw, u64 *ts);
index 199c4f938bb2bedb3ca24465c3cafdbfe5565fb7..5f40fbb67bac9fc57c4b59f2dea44a0cd35a52f4 100644 (file)
@@ -4214,6 +4214,7 @@ static u32 stmmac_vid_crc32_le(__le16 vid_le)
 static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
 {
        u32 crc, hash = 0;
+       __le16 pmatch = 0;
        int count = 0;
        u16 vid = 0;
 
@@ -4228,11 +4229,11 @@ static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
                if (count > 2) /* VID = 0 always passes filter */
                        return -EOPNOTSUPP;
 
-               vid = cpu_to_le16(vid);
+               pmatch = cpu_to_le16(vid);
                hash = 0;
        }
 
-       return stmmac_update_vlan_hash(priv, priv->hw, hash, vid, is_double);
+       return stmmac_update_vlan_hash(priv, priv->hw, hash, pmatch, is_double);
 }
 
 static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid)