linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Li Zetao <lizetao1@huawei.com>
Cc: geoff@infradead.org, npiggin@gmail.com, edumazet@google.com,
	netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com,
	linuxppc-dev@lists.ozlabs.org, davem@davemloft.net
Subject: Re: [PATCH -next] net/ps3_gelic_net: Use ether_addr_to_u64() to convert ethernet address
Date: Wed, 9 Aug 2023 16:39:57 +0200	[thread overview]
Message-ID: <ZNOlPdxAPzIcB0Ij@vergenet.net> (raw)
In-Reply-To: <20230808114050.4034547-1-lizetao1@huawei.com>

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

      parent reply	other threads:[~2023-08-09 14:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=ZNOlPdxAPzIcB0Ij@vergenet.net \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=geoff@infradead.org \
    --cc=kuba@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lizetao1@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=npiggin@gmail.com \
    --cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).