Commit 1bb96a07 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

mlx4: replace mlx4_u64_to_mac() with u64_to_ether_addr()

mlx4_u64_to_mac() predates the common helper but doesn't
make the argument constant.
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ded6e16b
...@@ -3195,7 +3195,7 @@ int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting) ...@@ -3195,7 +3195,7 @@ int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting)
port = mlx4_slaves_closest_port(dev, slave, port); port = mlx4_slaves_closest_port(dev, slave, port);
s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; s_info = &priv->mfunc.master.vf_admin[slave].vport[port];
mlx4_u64_to_mac(mac, s_info->mac); u64_to_ether_addr(s_info->mac, mac);
if (setting && !is_valid_ether_addr(mac)) { if (setting && !is_valid_ether_addr(mac)) {
mlx4_info(dev, "Illegal MAC with spoofchk\n"); mlx4_info(dev, "Illegal MAC with spoofchk\n");
return -EPERM; return -EPERM;
......
...@@ -92,14 +92,4 @@ void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int ...@@ -92,14 +92,4 @@ void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int
struct devlink_port *mlx4_get_devlink_port(struct mlx4_dev *dev, int port); struct devlink_port *mlx4_get_devlink_port(struct mlx4_dev *dev, int port);
static inline void mlx4_u64_to_mac(u8 *addr, u64 mac)
{
int i;
for (i = ETH_ALEN; i > 0; i--) {
addr[i - 1] = mac & 0xFF;
mac >>= 8;
}
}
#endif /* MLX4_DRIVER_H */ #endif /* MLX4_DRIVER_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment