net: usb: sr9700: use ETH_ALEN instead of magic number
Subsystems (4)
PATCH 1/1 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.
--- drivers/net/usb/sr9700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/sr9700.c +1 -1
@@ -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 ; }
Signature · 1 line
2.43.0
Quoted 5 lines · Ethan Nelson-Moore
The driver hardcodes the number 6 as the number of bytes to write to the
SR_PARregister, which stores the MAC address. UseETH_ALENinstead to make the code clearer.Signed-off-by Ethan Nelson-Moore <[email protected]>
Andrew
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Ethan" == Ethan Nelson-Moore <[email protected]> writes:
The driver hardcodes the number 6 as the number of bytes to write to the
SR_PARregister, which stores the MAC address. UseETH_ALENinstead to make the code clearer.Signed-off-by Ethan Nelson-Moore <[email protected]>
Signature · 1 line
Bye, Peter Korsgaard
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 22 Jan 2026 23:06:39 -0800 you wrote:
The driver hardcodes the number 6 as the number of bytes to write to the
SR_PARregister, which stores the MAC address. UseETH_ALENinstead to make the code clearer.Signed-off-by Ethan Nelson-Moore <[email protected]>--- drivers/net/usb/sr9700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [net-next] net: usb: sr9700: use ETH_ALEN instead of magic number
https://git.kernel.org/netdev/net-next/c/c2e99887807e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html