[PATCH net-next v4 05/18] net: dsa: mv88e6xxx: remove redundant check in mv88e6xxx_port_vlan()

Florian Fainelli f.fainelli at gmail.com
Sun Apr 17 05:38:09 AEST 2022



On 4/15/2022 5:29 AM, Jakob Koschel wrote:
> From: Vladimir Oltean <vladimir.oltean at nxp.com>
> 
> We know that "dev > dst->last_switch" in the "else" block.
> In other words, that "dev - dst->last_switch" is > 0.
> 
> dsa_port_bridge_num_get(dp) can be 0, but the check
> "if (bridge_num + dst->last_switch != dev) continue", rewritten as
> "if (bridge_num != dev - dst->last_switch) continue", aka
> "if (bridge_num != something which cannot be 0) continue",
> makes it redundant to have the extra "if (!bridge_num) continue" logic,
> since a bridge_num of zero would have been skipped anyway.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
> Signed-off-by: Jakob Koschel <jakobkoschel at gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
-- 
Florian


More information about the Linuxppc-dev mailing list