From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, tariqt@nvidia.com, yishaih@nvidia.com,
linux-rdma@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 2/4] mlx4: replace mlx4_u64_to_mac() with u64_to_ether_addr()
Date: Mon, 4 Oct 2021 12:14:44 -0700 [thread overview]
Message-ID: <20211004191446.2127522-3-kuba@kernel.org> (raw)
In-Reply-To: <20211004191446.2127522-1-kuba@kernel.org>
mlx4_u64_to_mac() predates the common helper but doesn't
make the argument constant.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/mellanox/mlx4/cmd.c | 2 +-
include/linux/mlx4/driver.h | 10 ----------
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index 9fadedfca41c..94ead263081f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -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);
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)) {
mlx4_info(dev, "Illegal MAC with spoofchk\n");
return -EPERM;
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index b26b71f62fb4..1834c8fad12e 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -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);
-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 */
--
2.31.1
next prev parent reply other threads:[~2021-10-04 19:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-04 19:14 [PATCH net-next 0/4] mlx4: prep for constant dev->dev_addr Jakub Kicinski
2021-10-04 19:14 ` [PATCH net-next 1/4] mlx4: replace mlx4_mac_to_u64() with ether_addr_to_u64() Jakub Kicinski
2021-10-05 9:55 ` Tariq Toukan
2021-10-04 19:14 ` Jakub Kicinski [this message]
2021-10-05 9:59 ` [PATCH net-next 2/4] mlx4: replace mlx4_u64_to_mac() with u64_to_ether_addr() Tariq Toukan
2021-10-04 19:14 ` [PATCH net-next 3/4] mlx4: remove custom dev_addr clearing Jakub Kicinski
2021-10-05 10:21 ` Tariq Toukan
2021-10-04 19:14 ` [PATCH net-next 4/4] mlx4: constify args for const dev_addr Jakub Kicinski
2021-10-05 10:27 ` Tariq Toukan
2021-10-05 10:28 ` [PATCH net-next 0/4] mlx4: prep for constant dev->dev_addr Tariq Toukan
2021-10-05 12:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211004191446.2127522-3-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tariqt@nvidia.com \
--cc=yishaih@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox