lkml.org 
[lkml]   [2015]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] decnet: remove macro-local declarations


On Thu, 5 Nov 2015, Joe Perches wrote:

> On Thu, 2015-11-05 at 20:38 +0100, Julia Lawall wrote:
> > On Thu, 5 Nov 2015, David Miller wrote:
> > > From: Julia Lawall <Julia.Lawall@lip6.fr>
> > > Date: Thu, 5 Nov 2015 11:18:16 +0100>
> > > > Move the variable declarations from the for_nexthops macro to the
> > > > surrounding context, so that it is clear where these variables are
> > > > declared. This also makes it possible to remove the endfor_nexthops macro.
> > > >
> > > > This change adds new arguments to the macro for_nexthops. They are ordered
> > > > such that a pointer to the referenced object comes first, the index in the
> > > > list comes next, and the list itself comes last, roughly in analogy with
> > > > the list_for_each macros.
> []
> > > > This patch takes care of a single file, where the macros are defined
> > > > locally. If the basic transformation looks OK, I will change the other
> > > > files that either likewise define their own macros or use the macros in
> > > > net/mpls/internal.h. The potentially affected files are:
> > > ...
> > >
> > > This looks fine to me.
> > >
> > > Please resubmit this when net-next opens back up, which should be
> > > shortly after -rc1.
> >
> > OK, I'll do the others then too.
>
> If you do can you please parenthesize the macro arguments?
>
> #define for_nexthops(nh, nhsel, fi) \
> for (nhsel = 0, nh = (fi)->fib_nh; nhsel < (fi)->fib_nhs; (nh)++, (nhsel)++)
> instead of
> for(nhsel = 0, nh = (fi)->fib_nh; nhsel < (fi)->fib_nhs; nh++, nhsel++)

OK

> And perhaps a renaming might be better
>
> s/for_nexthops/for_each_nexthop/

OK

Thanks for the suggestions.

julia


\
 
 \ /
  Last update: 2015-11-05 23:41    [W:0.046 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site