lkml.org 
[lkml]   [2019]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 1/7] net: dsa: list DSA links in the fabric
Hi David,

On Wed, 30 Oct 2019 14:39:49 -0700 (PDT), David Miller <davem@davemloft.net> wrote:
> From: Vivien Didelot <vivien.didelot@gmail.com>
> Date: Mon, 28 Oct 2019 15:52:14 -0400
>
> > @@ -122,6 +124,29 @@ static struct dsa_port *dsa_tree_find_port_by_node(struct dsa_switch_tree *dst,
> > return NULL;
> > }
> >
> > +struct dsa_link *dsa_link_touch(struct dsa_port *dp, struct dsa_port *link_dp)
> > +{
> > + struct dsa_switch *ds = dp->ds;
> > + struct dsa_switch_tree *dst = ds->dst;
> > + struct dsa_link *dl;
>
> Please fix the reverse christmas tree here, two suggestions:
>
> struct dsa_switch *ds = dp->ds;
> struct dsa_switch_tree *dst;
> struct dsa_link *dl;
>
> dst = ds->dst;
>
> Or, alternatively, since the dst variable is used only once, get rid of it
> and change:
>
> > + list_add_tail(&dl->list, &dst->rtable);
>
> to
>
> > + list_add_tail(&dl->list, &ds->dst->rtable);

No problem, I've sent a v2 using the first suggestion, since dst is in fact
used twice in this function.


Thank you,

Vivien

\
 
 \ /
  Last update: 2019-10-31 03:15    [W:0.046 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site