Skip to contentSkip to conversation

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

PATCH Applied Ethan Nelson-Moore 4 participants 4 messages Jan 23 – Jan 25

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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
index 9c7cd0db1768..446857de8e15 100644
@@ -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
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ethan Nelson-Moore
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_PAR register, which stores the MAC address. Use ETH_ALEN instead to make the code clearer.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw
In reply to Ethan Nelson-Moore
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_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(-)

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