Commit 978bb0ae authored by Jakub Kicinski's avatar Jakub Kicinski

net: s390: constify and use eth_hw_addr_set()

Commit 406f42fa ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Make sure local references to netdev->dev_addr are constant.
Acked-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5ed5b191
...@@ -2162,7 +2162,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev) ...@@ -2162,7 +2162,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
card->dev->ml_priv = card; card->dev->ml_priv = card;
card->dev->netdev_ops = &lcs_netdev_ops; card->dev->netdev_ops = &lcs_netdev_ops;
card->dev->dev_port = card->portno; card->dev->dev_port = card->portno;
memcpy(card->dev->dev_addr, card->mac, LCS_MAC_LENGTH); eth_hw_addr_set(card->dev, card->mac);
#ifdef CONFIG_IP_MULTICAST #ifdef CONFIG_IP_MULTICAST
if (!lcs_check_multicast_support(card)) if (!lcs_check_multicast_support(card))
card->dev->netdev_ops = &lcs_mc_netdev_ops; card->dev->netdev_ops = &lcs_mc_netdev_ops;
......
...@@ -4375,7 +4375,7 @@ static int qeth_setadpparms_change_macaddr_cb(struct qeth_card *card, ...@@ -4375,7 +4375,7 @@ static int qeth_setadpparms_change_macaddr_cb(struct qeth_card *card,
!(adp_cmd->hdr.flags & QETH_SETADP_FLAGS_VIRTUAL_MAC)) !(adp_cmd->hdr.flags & QETH_SETADP_FLAGS_VIRTUAL_MAC))
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
ether_addr_copy(card->dev->dev_addr, adp_cmd->data.change_addr.addr); eth_hw_addr_set(card->dev, adp_cmd->data.change_addr.addr);
return 0; return 0;
} }
...@@ -5046,7 +5046,7 @@ int qeth_vm_request_mac(struct qeth_card *card) ...@@ -5046,7 +5046,7 @@ int qeth_vm_request_mac(struct qeth_card *card)
QETH_CARD_TEXT(card, 2, "badmac"); QETH_CARD_TEXT(card, 2, "badmac");
QETH_CARD_HEX(card, 2, response->mac, ETH_ALEN); QETH_CARD_HEX(card, 2, response->mac, ETH_ALEN);
} else { } else {
ether_addr_copy(card->dev->dev_addr, response->mac); eth_hw_addr_set(card->dev, response->mac);
} }
out: out:
......
...@@ -71,7 +71,7 @@ static int qeth_l2_send_setdelmac_cb(struct qeth_card *card, ...@@ -71,7 +71,7 @@ static int qeth_l2_send_setdelmac_cb(struct qeth_card *card,
return qeth_l2_setdelmac_makerc(card, cmd->hdr.return_code); return qeth_l2_setdelmac_makerc(card, cmd->hdr.return_code);
} }
static int qeth_l2_send_setdelmac(struct qeth_card *card, __u8 *mac, static int qeth_l2_send_setdelmac(struct qeth_card *card, const __u8 *mac,
enum qeth_ipa_cmds ipacmd) enum qeth_ipa_cmds ipacmd)
{ {
struct qeth_ipa_cmd *cmd; struct qeth_ipa_cmd *cmd;
...@@ -88,7 +88,7 @@ static int qeth_l2_send_setdelmac(struct qeth_card *card, __u8 *mac, ...@@ -88,7 +88,7 @@ static int qeth_l2_send_setdelmac(struct qeth_card *card, __u8 *mac,
return qeth_send_ipa_cmd(card, iob, qeth_l2_send_setdelmac_cb, NULL); return qeth_send_ipa_cmd(card, iob, qeth_l2_send_setdelmac_cb, NULL);
} }
static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac) static int qeth_l2_send_setmac(struct qeth_card *card, const __u8 *mac)
{ {
int rc; int rc;
...@@ -377,7 +377,7 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p) ...@@ -377,7 +377,7 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
if (rc) if (rc)
return rc; return rc;
ether_addr_copy(old_addr, dev->dev_addr); ether_addr_copy(old_addr, dev->dev_addr);
ether_addr_copy(dev->dev_addr, addr->sa_data); eth_hw_addr_set(dev, addr->sa_data);
if (card->info.dev_addr_is_registered) if (card->info.dev_addr_is_registered)
qeth_l2_remove_mac(card, old_addr); qeth_l2_remove_mac(card, old_addr);
......
...@@ -913,8 +913,7 @@ static int qeth_l3_iqd_read_initial_mac_cb(struct qeth_card *card, ...@@ -913,8 +913,7 @@ static int qeth_l3_iqd_read_initial_mac_cb(struct qeth_card *card,
if (!is_valid_ether_addr(cmd->data.create_destroy_addr.mac_addr)) if (!is_valid_ether_addr(cmd->data.create_destroy_addr.mac_addr))
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
ether_addr_copy(card->dev->dev_addr, eth_hw_addr_set(card->dev, cmd->data.create_destroy_addr.mac_addr);
cmd->data.create_destroy_addr.mac_addr);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment