ethernet: add a helper for assigning port addresses
authorJakub Kicinski <kuba@kernel.org>
Mon, 18 Oct 2021 21:10:02 +0000 (14:10 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Oct 2021 11:46:24 +0000 (12:46 +0100)
commite80094a473eefad9d856ce3ab0d7afdbb64800c4
tree248188e81bcc28400b9daf986d2b41abe1dad90b
parent867a92846e2eee774a9a995793e3bb964676b33e
ethernet: add a helper for assigning port addresses

We have 5 drivers which offset base MAC addr by port id.
Create a helper for them.

This helper takes care of overflows, which some drivers
did not do, please complain if that's going to break
anything!

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/etherdevice.h