net: ethernet: adi: adin1110: use eth_broadcast_addr() to assign broadcast address
Use eth_broadcast_addr() to assign broadcast address instead of memset(). Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
813f3662c2
commit
54024dbec9
@ -739,7 +739,7 @@ static int adin1110_broadcasts_filter(struct adin1110_port_priv *port_priv,
|
|||||||
u32 port_rules = 0;
|
u32 port_rules = 0;
|
||||||
u8 mask[ETH_ALEN];
|
u8 mask[ETH_ALEN];
|
||||||
|
|
||||||
memset(mask, 0xFF, ETH_ALEN);
|
eth_broadcast_addr(mask);
|
||||||
|
|
||||||
if (accept_broadcast && port_priv->state == BR_STATE_FORWARDING)
|
if (accept_broadcast && port_priv->state == BR_STATE_FORWARDING)
|
||||||
port_rules = adin1110_port_rules(port_priv, true, true);
|
port_rules = adin1110_port_rules(port_priv, true, true);
|
||||||
@ -760,7 +760,7 @@ static int adin1110_set_mac_address(struct net_device *netdev,
|
|||||||
return -EADDRNOTAVAIL;
|
return -EADDRNOTAVAIL;
|
||||||
|
|
||||||
eth_hw_addr_set(netdev, dev_addr);
|
eth_hw_addr_set(netdev, dev_addr);
|
||||||
memset(mask, 0xFF, ETH_ALEN);
|
eth_broadcast_addr(mask);
|
||||||
|
|
||||||
mac_slot = (!port_priv->nr) ? ADIN_MAC_P1_ADDR_SLOT : ADIN_MAC_P2_ADDR_SLOT;
|
mac_slot = (!port_priv->nr) ? ADIN_MAC_P1_ADDR_SLOT : ADIN_MAC_P2_ADDR_SLOT;
|
||||||
port_rules = adin1110_port_rules(port_priv, true, false);
|
port_rules = adin1110_port_rules(port_priv, true, false);
|
||||||
@ -1271,7 +1271,7 @@ static int adin1110_port_set_blocking_state(struct adin1110_port_priv *port_priv
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* Allow only BPDUs to be passed to the CPU */
|
/* Allow only BPDUs to be passed to the CPU */
|
||||||
memset(mask, 0xFF, ETH_ALEN);
|
eth_broadcast_addr(mask);
|
||||||
port_rules = adin1110_port_rules(port_priv, true, false);
|
port_rules = adin1110_port_rules(port_priv, true, false);
|
||||||
ret = adin1110_write_mac_address(port_priv, mac_slot, mac,
|
ret = adin1110_write_mac_address(port_priv, mac_slot, mac,
|
||||||
mask, port_rules);
|
mask, port_rules);
|
||||||
@ -1386,7 +1386,7 @@ static int adin1110_fdb_add(struct adin1110_port_priv *port_priv,
|
|||||||
|
|
||||||
other_port = priv->ports[!port_priv->nr];
|
other_port = priv->ports[!port_priv->nr];
|
||||||
port_rules = adin1110_port_rules(port_priv, false, true);
|
port_rules = adin1110_port_rules(port_priv, false, true);
|
||||||
memset(mask, 0xFF, ETH_ALEN);
|
eth_broadcast_addr(mask);
|
||||||
|
|
||||||
return adin1110_write_mac_address(other_port, mac_nr, (u8 *)fdb->addr,
|
return adin1110_write_mac_address(other_port, mac_nr, (u8 *)fdb->addr,
|
||||||
mask, port_rules);
|
mask, port_rules);
|
||||||
|
Loading…
Reference in New Issue
Block a user