mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
net: remove single-byte netdev->dev_addr writes
Make the drivers which use single-byte netdev addresses (netdev->addr_len == 1) use the appropriate address setting helpers. arcnet copies from int variables and io reads a lot, so add a helper for arcnet drivers to use. Similar helper could be reused for phonet and appletalk but there isn't any good central location where we could put it, and netdevice.h is already very crowded. Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for HSI Link: https://lore.kernel.org/r/20211012142757.4124842-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -1055,14 +1055,16 @@ static const struct net_device_ops ssip_pn_ops = {
|
||||
|
||||
static void ssip_pn_setup(struct net_device *dev)
|
||||
{
|
||||
static const u8 addr = PN_MEDIA_SOS;
|
||||
|
||||
dev->features = 0;
|
||||
dev->netdev_ops = &ssip_pn_ops;
|
||||
dev->type = ARPHRD_PHONET;
|
||||
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
|
||||
dev->mtu = SSIP_DEFAULT_MTU;
|
||||
dev->hard_header_len = 1;
|
||||
dev->dev_addr[0] = PN_MEDIA_SOS;
|
||||
dev->addr_len = 1;
|
||||
dev_addr_set(dev, &addr);
|
||||
dev->tx_queue_len = SSIP_TXQUEUE_LEN;
|
||||
|
||||
dev->needs_free_netdev = true;
|
||||
|
||||
Reference in New Issue
Block a user