* [PATCH -next] net/ps3_gelic_net: Use ether_addr_to_u64() to convert ethernet address
@ 2023-08-08 11:40 Li Zetao
2023-08-08 17:32 ` Geoff Levand
2023-08-09 14:39 ` Simon Horman
0 siblings, 2 replies; 3+ messages in thread
From: Li Zetao @ 2023-08-08 11:40 UTC (permalink / raw)
To: geoff, davem, edumazet, kuba, pabeni, mpe, npiggin,
christophe.leroy
Cc: netdev, lizetao1, linuxppc-dev
Use ether_addr_to_u64() to convert an Ethernet address into a u64 value,
instead of directly calculating, as this is exactly what
this function does.
Signed-off-by: Li Zetao <lizetao1@huawei.com>
---
drivers/net/ethernet/toshiba/ps3_gelic_net.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index 9d535ae59626..77a02819e412 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -596,7 +596,6 @@ void gelic_net_set_multi(struct net_device *netdev)
struct gelic_card *card = netdev_card(netdev);
struct netdev_hw_addr *ha;
unsigned int i;
- uint8_t *p;
u64 addr;
int status;
@@ -629,12 +628,7 @@ void gelic_net_set_multi(struct net_device *netdev)
/* set multicast addresses */
netdev_for_each_mc_addr(ha, netdev) {
- addr = 0;
- p = ha->addr;
- for (i = 0; i < ETH_ALEN; i++) {
- addr <<= 8;
- addr |= *p++;
- }
+ addr = ether_addr_to_u64(ha->addr);
status = lv1_net_add_multicast_address(bus_id(card),
dev_id(card),
addr, 0);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] net/ps3_gelic_net: Use ether_addr_to_u64() to convert ethernet address
2023-08-08 11:40 [PATCH -next] net/ps3_gelic_net: Use ether_addr_to_u64() to convert ethernet address Li Zetao
@ 2023-08-08 17:32 ` Geoff Levand
2023-08-09 14:39 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Geoff Levand @ 2023-08-08 17:32 UTC (permalink / raw)
To: Li Zetao, davem, edumazet, kuba, pabeni, mpe, npiggin,
christophe.leroy
Cc: netdev, linuxppc-dev
Hi,
On 8/8/23 04:40, Li Zetao wrote:
> Use ether_addr_to_u64() to convert an Ethernet address into a u64 value,
> instead of directly calculating, as this is exactly what
> this function does.
>
> Signed-off-by: Li Zetao <lizetao1@huawei.com>
> ---
> drivers/net/ethernet/toshiba/ps3_gelic_net.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
I tested this on PS3 and it seems to be working OK.
Thanks for your contribution.
Tested-by: Geoff Levand <geoff@infradead.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] net/ps3_gelic_net: Use ether_addr_to_u64() to convert ethernet address
2023-08-08 11:40 [PATCH -next] net/ps3_gelic_net: Use ether_addr_to_u64() to convert ethernet address Li Zetao
2023-08-08 17:32 ` Geoff Levand
@ 2023-08-09 14:39 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-08-09 14:39 UTC (permalink / raw)
To: Li Zetao
Cc: geoff, npiggin, edumazet, netdev, kuba, pabeni, linuxppc-dev,
davem
On Tue, Aug 08, 2023 at 07:40:50PM +0800, Li Zetao wrote:
> Use ether_addr_to_u64() to convert an Ethernet address into a u64 value,
> instead of directly calculating, as this is exactly what
> this function does.
>
> Signed-off-by: Li Zetao <lizetao1@huawei.com>
> ---
> drivers/net/ethernet/toshiba/ps3_gelic_net.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
> index 9d535ae59626..77a02819e412 100644
> --- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
> +++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
> @@ -596,7 +596,6 @@ void gelic_net_set_multi(struct net_device *netdev)
> struct gelic_card *card = netdev_card(netdev);
> struct netdev_hw_addr *ha;
> unsigned int i;
Hi Li Zetao,
It looks like i is now unused in this function and should be removed.
> - uint8_t *p;
> u64 addr;
> int status;
>
> @@ -629,12 +628,7 @@ void gelic_net_set_multi(struct net_device *netdev)
>
> /* set multicast addresses */
> netdev_for_each_mc_addr(ha, netdev) {
> - addr = 0;
> - p = ha->addr;
> - for (i = 0; i < ETH_ALEN; i++) {
> - addr <<= 8;
> - addr |= *p++;
> - }
> + addr = ether_addr_to_u64(ha->addr);
> status = lv1_net_add_multicast_address(bus_id(card),
> dev_id(card),
> addr, 0);
> --
> 2.34.1
--
pw-bot: changes-requested
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-09 14:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08 11:40 [PATCH -next] net/ps3_gelic_net: Use ether_addr_to_u64() to convert ethernet address Li Zetao
2023-08-08 17:32 ` Geoff Levand
2023-08-09 14:39 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).