Subject: Re: [PATCH RFC v2 09/21] net: rbridge: add elected dtroot

From: Sergei Shtylyov <[email-masked]>
Date: Tue, 1 Sep 2015 21:18:29 +0300

Hello.

On 09/01/2015 06:43 PM, Ahmed Amamou wrote:

> Signed-off-by: Ahmed Amamou <[email-masked]>
> ---
>   net/bridge/rbr.c           | 14 ++++++++++++++
>   net/bridge/rbr_private.h   |  2 ++
>   net/bridge/rbr_rtnetlink.c |  6 ++++++
>   3 files changed, 22 insertions(+)
>
> diff --git a/net/bridge/rbr.c b/net/bridge/rbr.c
> index c554743..31e72ef 100644
> --- a/net/bridge/rbr.c
> +++ b/net/bridge/rbr.c
> @@ -69,3 +69,17 @@ void br_trill_set_enabled(struct net_bridge *br, unsigned long val)
>   			br_trill_stop(br);
>   	}
>   }
> +
> +int set_treeroot(struct rbr *rbr, uint16_t treeroot)
> +{
> +	if (unlikely(!VALID_NICK(treeroot))) {
> +		pr_warn_ratelimited
> +			("rbr_set_treeroot: given tree root not valid\n");
> +		goto set_tree_root_fail;

    This seems a bit stupid. Why not *return* directly?

> +	}
> +	if (rbr->treeroot != treeroot)
> +		rbr->treeroot = treeroot;
> +	return 0;
> + set_tree_root_fail:
> +	return -ENOENT;
> +}
[...]

MBR, Sergei