net: usb: sr9700: use ETH_ALEN instead of magic number

The driver hardcodes the number 6 as the number of bytes to write to
the SR_PAR register, which stores the MAC address. Use ETH_ALEN instead
to make the code clearer.

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Peter Korsgaard <peter@korsgaard.com>
Link: https://patch.msgid.link/20260123070645.56434-1-enelsonmoore@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Ethan Nelson-Moore 2026-01-22 23:06:39 -08:00 committed by Jakub Kicinski
parent 6290f7e71b
commit c2e9988780

View File

@ -271,7 +271,7 @@ static int sr9700_set_mac_address(struct net_device *netdev, void *p)
}
eth_hw_addr_set(netdev, addr->sa_data);
sr_write_async(dev, SR_PAR, 6, netdev->dev_addr);
sr_write_async(dev, SR_PAR, ETH_ALEN, netdev->dev_addr);
return 0;
}