aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
authorUday Shankar <[email protected]>2025-03-12 19:51:46 +0000
committerPaolo Abeni <[email protected]>2025-03-19 18:17:58 +0000
commit6d6c1ba7824022528dbe3e283fafbd0775424128 (patch)
tree0887dedc1321e397e52db3e50b2079c2b6c9e75f /drivers/net/netconsole.c
parentr8169: switch away from deprecated pcim_iomap_table (diff)
downloadkernel-6d6c1ba7824022528dbe3e283fafbd0775424128.tar.gz
kernel-6d6c1ba7824022528dbe3e283fafbd0775424128.zip
net, treewide: define and use MAC_ADDR_STR_LEN
There are a few places in the tree which compute the length of the string representation of a MAC address as 3 * ETH_ALEN - 1. Define a constant for this and use it where relevant. No functionality changes are expected. Signed-off-by: Uday Shankar <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Acked-by: Johannes Berg <[email protected]> Reviewed-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r--drivers/net/netconsole.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 098ea9eb0237..43757b5c0216 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -739,7 +739,7 @@ static ssize_t remote_mac_store(struct config_item *item, const char *buf,
if (!mac_pton(buf, remote_mac))
goto out_unlock;
- if (buf[3 * ETH_ALEN - 1] && buf[3 * ETH_ALEN - 1] != '\n')
+ if (buf[MAC_ADDR_STR_LEN] && buf[MAC_ADDR_STR_LEN] != '\n')
goto out_unlock;
memcpy(nt->np.remote_mac, remote_mac, ETH_ALEN);