Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1264907

Re: [PATCH] decnet: remove macro-local declarations

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH] decnet: remove macro-local declarations
Date 2015-11-07 19:20 +0100
Message-ID <qsgfM-5MQ-11@gated-at.bofh.it> (permalink)
References <qrz17-2QW-19@gated-at.bofh.it> <qrzaO-2TZ-17@gated-at.bofh.it> <qrMUq-3qm-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Julia Lawall <julia.lawall@lip6.fr>
Date: Fri, 6 Nov 2015 11:57:34 +0100 (CET)

>> > Would it be preferable to remove the macro entirely and inline the for
>> > loop header?
>>
>> Could you show me an example of how this would look exactly?
> 
> One possible solution is below.  I moved the initialization of the nh
> pointer inside the loop to reduce the size of the loop header.  One could
> also inline fi->fib_nh[nhsel] where it occurs, but it seemed that that
> would make quite long expressions.

Personally I like the explicit named iterator.  It is descriptive and
tells that we are walking over all of the nexthops for a route.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] decnet: remove macro-local declarations Julia Lawall <Julia.Lawall@lip6.fr> - 2015-11-05 11:30 +0100
  Re: [PATCH] decnet: remove macro-local declarations David Miller <davem@davemloft.net> - 2015-11-05 20:30 +0100
    Re: [PATCH] decnet: remove macro-local declarations Julia Lawall <julia.lawall@lip6.fr> - 2015-11-05 20:40 +0100
      Re: [PATCH] decnet: remove macro-local declarations Joe Perches <joe@perches.com> - 2015-11-05 23:10 +0100
        Re: [PATCH] decnet: remove macro-local declarations Julia Lawall <julia.lawall@lip6.fr> - 2015-11-05 23:30 +0100
    Re: [PATCH] decnet: remove macro-local declarations Julia Lawall <julia.lawall@lip6.fr> - 2015-11-05 21:10 +0100
      Re: [PATCH] decnet: remove macro-local declarations David Miller <davem@davemloft.net> - 2015-11-05 21:20 +0100
        Re: [PATCH] decnet: remove macro-local declarations Julia Lawall <julia.lawall@lip6.fr> - 2015-11-06 12:00 +0100
          Re: [PATCH] decnet: remove macro-local declarations walter harms <wharms@bfs.de> - 2015-11-06 12:50 +0100
            Re: [PATCH] decnet: remove macro-local declarations Julia Lawall <julia.lawall@lip6.fr> - 2015-11-06 12:50 +0100
          Re: [PATCH] decnet: remove macro-local declarations David Miller <davem@davemloft.net> - 2015-11-07 19:20 +0100
            Re: [PATCH] decnet: remove macro-local declarations Julia Lawall <julia.lawall@lip6.fr> - 2015-11-07 19:30 +0100

csiph-web