mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 23:39:18 +00:00
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: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
cda9de0b8d
commit
3f07ce8e52
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user