Skip to content

Commit a24cae7

Browse files
joabreudavem330
authored andcommitted
net: stmmac: Fix sparse warning
The VID is converted to le16 so the variable must be __le16 type. Reported-by: kbuild test robot <[email protected]> Fixes: c7ab0b8 ("net: stmmac: Fallback to VLAN Perfect filtering if HASH is not available") Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2971130 commit a24cae7

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ static void dwmac4_set_mac_loopback(void __iomem *ioaddr, bool enable)
733733
}
734734

735735
static void dwmac4_update_vlan_hash(struct mac_device_info *hw, u32 hash,
736-
u16 perfect_match, bool is_double)
736+
__le16 perfect_match, bool is_double)
737737
{
738738
void __iomem *ioaddr = hw->pcsr;
739739

drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ static int dwxgmac2_rss_configure(struct mac_device_info *hw,
556556
}
557557

558558
static void dwxgmac2_update_vlan_hash(struct mac_device_info *hw, u32 hash,
559-
u16 perfect_match, bool is_double)
559+
__le16 perfect_match, bool is_double)
560560
{
561561
void __iomem *ioaddr = hw->pcsr;
562562

drivers/net/ethernet/stmicro/stmmac/hwif.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ struct stmmac_ops {
357357
struct stmmac_rss *cfg, u32 num_rxq);
358358
/* VLAN */
359359
void (*update_vlan_hash)(struct mac_device_info *hw, u32 hash,
360-
u16 perfect_match, bool is_double);
360+
__le16 perfect_match, bool is_double);
361361
void (*enable_vlan)(struct mac_device_info *hw, u32 type);
362362
/* TX Timestamp */
363363
int (*get_mac_tx_timestamp)(struct mac_device_info *hw, u64 *ts);

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4214,6 +4214,7 @@ static u32 stmmac_vid_crc32_le(__le16 vid_le)
42144214
static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
42154215
{
42164216
u32 crc, hash = 0;
4217+
__le16 pmatch = 0;
42174218
int count = 0;
42184219
u16 vid = 0;
42194220

@@ -4228,11 +4229,11 @@ static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
42284229
if (count > 2) /* VID = 0 always passes filter */
42294230
return -EOPNOTSUPP;
42304231

4231-
vid = cpu_to_le16(vid);
4232+
pmatch = cpu_to_le16(vid);
42324233
hash = 0;
42334234
}
42344235

4235-
return stmmac_update_vlan_hash(priv, priv->hw, hash, vid, is_double);
4236+
return stmmac_update_vlan_hash(priv, priv->hw, hash, pmatch, is_double);
42364237
}
42374238

42384239
static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid)

0 commit comments

Comments
 (0)