Commit 3f07ce8e authored by Zou Wei's avatar Zou Wei Committed by David S. Miller

net: dsa: hellcreek: Use is_zero_ether_addr() instead of memcmp()

Using is_zero_ether_addr() instead of directly use
memcmp() to determine if the ethernet address is all
zeros.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
Reviewed-by: Kurt Kanzenbach's avatarKurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cda9de0b
...@@ -927,7 +927,6 @@ static int hellcreek_fdb_dump(struct dsa_switch *ds, int port, ...@@ -927,7 +927,6 @@ static int hellcreek_fdb_dump(struct dsa_switch *ds, int port,
/* Read table */ /* Read table */
for (i = 0; i < hellcreek->fdb_entries; ++i) { for (i = 0; i < hellcreek->fdb_entries; ++i) {
unsigned char null_addr[ETH_ALEN] = { 0 };
struct hellcreek_fdb_entry entry = { 0 }; struct hellcreek_fdb_entry entry = { 0 };
/* Read entry */ /* Read entry */
...@@ -937,7 +936,7 @@ static int hellcreek_fdb_dump(struct dsa_switch *ds, int port, ...@@ -937,7 +936,7 @@ static int hellcreek_fdb_dump(struct dsa_switch *ds, int port,
hellcreek_write(hellcreek, 0x00, HR_FDBRDH); hellcreek_write(hellcreek, 0x00, HR_FDBRDH);
/* Check valid */ /* Check valid */
if (!memcmp(entry.mac, null_addr, ETH_ALEN)) if (is_zero_ether_addr(entry.mac))
continue; continue;
/* Check port mask */ /* Check port mask */
......
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