[Bridge] [PATCH] net: bridge: remove redundant continue statement

Nikolay Aleksandrov nikolay at nvidia.com
Fri Jun 18 10:12:32 UTC 2021


On 18/06/2021 13:01, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> The continue statement at the end of a for-loop has no effect,
> invert the if expression and remove the continue.
> 
> Addresses-Coverity: ("Continue has no effect")
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  net/bridge/br_vlan.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
> index da3256a3eed0..8789a57af543 100644
> --- a/net/bridge/br_vlan.c
> +++ b/net/bridge/br_vlan.c
> @@ -113,9 +113,7 @@ static void __vlan_add_list(struct net_bridge_vlan *v)
>  	headp = &vg->vlan_list;
>  	list_for_each_prev(hpos, headp) {
>  		vent = list_entry(hpos, struct net_bridge_vlan, vlist);
> -		if (v->vid < vent->vid)
> -			continue;
> -		else
> +		if (v->vid >= vent->vid)
>  			break;
>  	}
>  	list_add_rcu(&v->vlist, hpos);
> 

This should be targeted at net-next. Thanks,
Acked-by: Nikolay Aleksandrov <nikolay at nvidia.com>


More information about the Bridge mailing list