All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] net: dsa: hellcreek: Use is_zero_ether_addr() instead of memcmp()
@ 2021-06-07  2:57 Zou Wei
  2021-06-07  5:40 ` Kurt Kanzenbach
  2021-06-07 20:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Zou Wei @ 2021-06-07  2:57 UTC (permalink / raw)
  To: kurt, andrew, vivien.didelot, f.fainelli, olteanv, davem, kuba
  Cc: netdev, linux-kernel, Zou Wei

Using is_zero_ether_addr() instead of directly use
memcmp() to determine if the ethernet address is all
zeros.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
 drivers/net/dsa/hirschmann/hellcreek.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
index 4d78219..9fdcc4b 100644
--- a/drivers/net/dsa/hirschmann/hellcreek.c
+++ b/drivers/net/dsa/hirschmann/hellcreek.c
@@ -927,7 +927,6 @@ static int hellcreek_fdb_dump(struct dsa_switch *ds, int port,
 
 	/* Read table */
 	for (i = 0; i < hellcreek->fdb_entries; ++i) {
-		unsigned char null_addr[ETH_ALEN] = { 0 };
 		struct hellcreek_fdb_entry entry = { 0 };
 
 		/* Read entry */
@@ -937,7 +936,7 @@ static int hellcreek_fdb_dump(struct dsa_switch *ds, int port,
 		hellcreek_write(hellcreek, 0x00, HR_FDBRDH);
 
 		/* Check valid */
-		if (!memcmp(entry.mac, null_addr, ETH_ALEN))
+		if (is_zero_ether_addr(entry.mac))
 			continue;
 
 		/* Check port mask */
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] net: dsa: hellcreek: Use is_zero_ether_addr() instead of memcmp()
  2021-06-07  2:57 [PATCH -next] net: dsa: hellcreek: Use is_zero_ether_addr() instead of memcmp() Zou Wei
@ 2021-06-07  5:40 ` Kurt Kanzenbach
  2021-06-07 20:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Kurt Kanzenbach @ 2021-06-07  5:40 UTC (permalink / raw)
  To: Zou Wei, andrew, vivien.didelot, f.fainelli, olteanv, davem, kuba
  Cc: netdev, linux-kernel, Zou Wei

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

On Mon Jun 07 2021, Zou Wei wrote:
> Using is_zero_ether_addr() instead of directly use
> memcmp() to determine if the ethernet address is all
> zeros.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>

Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] net: dsa: hellcreek: Use is_zero_ether_addr() instead of memcmp()
  2021-06-07  2:57 [PATCH -next] net: dsa: hellcreek: Use is_zero_ether_addr() instead of memcmp() Zou Wei
  2021-06-07  5:40 ` Kurt Kanzenbach
@ 2021-06-07 20:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-07 20:20 UTC (permalink / raw)
  To: Zou Wei
  Cc: kurt, andrew, vivien.didelot, f.fainelli, olteanv, davem, kuba,
	netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Mon, 7 Jun 2021 10:57:09 +0800 you wrote:
> Using is_zero_ether_addr() instead of directly use
> memcmp() to determine if the ethernet address is all
> zeros.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> 
> [...]

Here is the summary with links:
  - [-next] net: dsa: hellcreek: Use is_zero_ether_addr() instead of memcmp()
    https://git.kernel.org/netdev/net-next/c/3f07ce8e5287

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-07 20:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07  2:57 [PATCH -next] net: dsa: hellcreek: Use is_zero_ether_addr() instead of memcmp() Zou Wei
2021-06-07  5:40 ` Kurt Kanzenbach
2021-06-07 20:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.