Skip to content

Commit

Permalink
net: mscc: ocelot: remove the "new" variable in ocelot_port_mdb_add
Browse files Browse the repository at this point in the history
It is Not Needed, a comment will suffice.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Vladimir Oltean authored and Jakub Kicinski committed Oct 31, 2020
1 parent ebbd860 commit 728e69a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/ethernet/mscc/ocelot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,6 @@ int ocelot_port_mdb_add(struct ocelot *ocelot, int port,
unsigned char addr[ETH_ALEN];
struct ocelot_multicast *mc;
u16 vid = mdb->vid;
bool new = false;

if (port == ocelot->npi)
port = ocelot->num_phys_ports;
Expand All @@ -1029,6 +1028,7 @@ int ocelot_port_mdb_add(struct ocelot *ocelot, int port,

mc = ocelot_multicast_get(ocelot, mdb->addr, vid);
if (!mc) {
/* New entry */
int pgid = ocelot_mdb_get_pgid(ocelot, entry_type);

if (pgid < 0) {
Expand All @@ -1047,10 +1047,7 @@ int ocelot_port_mdb_add(struct ocelot *ocelot, int port,
mc->pgid = pgid;

list_add_tail(&mc->list, &ocelot->multicast);
new = true;
}

if (!new) {
} else {
ocelot_encode_ports_to_mdb(addr, mc, entry_type);
ocelot_mact_forget(ocelot, addr, vid);
}
Expand Down

0 comments on commit 728e69a

Please sign in to comment.