Re: [kbuild-all] [PATCH] mpls: fix semicolon.cocci warnings

2015-11-04 Thread David Miller
From: Julia Lawall 
Date: Wed, 4 Nov 2015 07:50:05 +0100 (CET)

> The whole idea of a macro that declares variables some of which are then 
> used in the code under the macro also seems quite unpleasant.  Other 
> iterators don't do this, and so they don't need the end marker.

I'm open minded about cleaning these iterators up.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [kbuild-all] [PATCH] mpls: fix semicolon.cocci warnings

2015-11-03 Thread Fengguang Wu
On Tue, Nov 03, 2015 at 11:17:36AM -0500, David Miller wrote:
> From: kbuild test robot 
> Date: Tue, 3 Nov 2015 23:25:39 +0800
> 
> > net/mpls/af_mpls.c:722:22-23: Unneeded semicolon
> > 
> > 
> >  Remove unneeded semicolon.
> > 
> > Generated by: scripts/coccinelle/misc/semicolon.cocci
> > 
> > CC: Roopa Prabhu 
> > Signed-off-by: Fengguang Wu 
> > ---
> > 
> >  af_mpls.c |4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > --- a/net/mpls/af_mpls.c
> > +++ b/net/mpls/af_mpls.c
> > @@ -719,9 +719,9 @@ static int mpls_nh_build_multi(struct mp
> >  
> > rtnh = rtnh_next(rtnh, );
> > nhs++;
> > -   } endfor_nexthops(rt);
> > +   } endfor_nexthops(rt)
> >  
> > -   rt->rt_nhn = nhs;
> > +   rt->rt_nhn = nhs;
> 
> This new indentation of "rt->rt_nhn = nhs;" is not correct.

Yes. CC Julia for coccinelle.

Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [kbuild-all] [PATCH] mpls: fix semicolon.cocci warnings

2015-11-03 Thread Julia Lawall


On Wed, 4 Nov 2015, Fengguang Wu wrote:

> On Tue, Nov 03, 2015 at 11:17:36AM -0500, David Miller wrote:
> > From: kbuild test robot 
> > Date: Tue, 3 Nov 2015 23:25:39 +0800
> > 
> > > net/mpls/af_mpls.c:722:22-23: Unneeded semicolon
> > > 
> > > 
> > >  Remove unneeded semicolon.
> > > 
> > > Generated by: scripts/coccinelle/misc/semicolon.cocci
> > > 
> > > CC: Roopa Prabhu 
> > > Signed-off-by: Fengguang Wu 
> > > ---
> > > 
> > >  af_mpls.c |4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > --- a/net/mpls/af_mpls.c
> > > +++ b/net/mpls/af_mpls.c
> > > @@ -719,9 +719,9 @@ static int mpls_nh_build_multi(struct mp
> > >  
> > >   rtnh = rtnh_next(rtnh, );
> > >   nhs++;
> > > - } endfor_nexthops(rt);
> > > + } endfor_nexthops(rt)
> > >  
> > > - rt->rt_nhn = nhs;
> > > + rt->rt_nhn = nhs;
> > 
> > This new indentation of "rt->rt_nhn = nhs;" is not correct.
> 
> Yes. CC Julia for coccinelle.

I will look into it, but Coccinelle is probably thrown off by there being 
what looks like a function call on the same line as a close brace.

I saw that quite a lot of other calls to endfor_nexthops also have 
semicolons.

The whole idea of a macro that declares variables some of which are then 
used in the code under the macro also seems quite unpleasant.  Other 
iterators don't do this, and so they don't need the end marker.

julia
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html