diff mbox

mpls: fix semicolon.cocci warnings

Message ID 20151103152539.GA63052@cairo
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

kernel test robot Nov. 3, 2015, 3:25 p.m. UTC
net/mpls/af_mpls.c:722:22-23: Unneeded semicolon


 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

CC: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 af_mpls.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

Comments

David Miller Nov. 3, 2015, 4:17 p.m. UTC | #1
From: kbuild test robot <lkp@intel.com>
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 <roopa@cumulusnetworks.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> 
>  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, &remaining);
>  		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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
kernel test robot Nov. 4, 2015, 2:01 a.m. UTC | #2
On Tue, Nov 03, 2015 at 11:17:36AM -0500, David Miller wrote:
> From: kbuild test robot <lkp@intel.com>
> 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 <roopa@cumulusnetworks.com>
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> > ---
> > 
> >  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, &remaining);
> >  		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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Julia Lawall Nov. 4, 2015, 6:50 a.m. UTC | #3
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 <lkp@intel.com>
> > 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 <roopa@cumulusnetworks.com>
> > > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> > > ---
> > > 
> > >  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, &remaining);
> > >  		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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Nov. 4, 2015, 2:57 p.m. UTC | #4
From: Julia Lawall <julia.lawall@lip6.fr>
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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 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, &remaining);
 		nhs++;
-	} endfor_nexthops(rt);
+	} endfor_nexthops(rt)
 
-	rt->rt_nhn = nhs;
+		rt->rt_nhn = nhs;
 
 	return 0;