Skip to content

Commit 3f07ce8

Browse files
SamuelZOUdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Zou Wei <[email protected]> Reviewed-by: Kurt Kanzenbach <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cda9de0 commit 3f07ce8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/dsa/hirschmann/hellcreek.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,6 @@ static int hellcreek_fdb_dump(struct dsa_switch *ds, int port,
927927

928928
/* Read table */
929929
for (i = 0; i < hellcreek->fdb_entries; ++i) {
930-
unsigned char null_addr[ETH_ALEN] = { 0 };
931930
struct hellcreek_fdb_entry entry = { 0 };
932931

933932
/* Read entry */
@@ -937,7 +936,7 @@ static int hellcreek_fdb_dump(struct dsa_switch *ds, int port,
937936
hellcreek_write(hellcreek, 0x00, HR_FDBRDH);
938937

939938
/* Check valid */
940-
if (!memcmp(entry.mac, null_addr, ETH_ALEN))
939+
if (is_zero_ether_addr(entry.mac))
941940
continue;
942941

943942
/* Check port mask */

0 commit comments

Comments
 (0)