From: Jack Morgenstein <ja...@dev.mellanox.co.il>
Date: Mon, 1 Jul 2013 14:44:54 +0300

> On Saturday 29 June 2013 07:10, David Miller wrote:
>> From: Or Gerlitz <ogerl...@mellanox.com>
>> Date: Wed, 26 Jun 2013 17:22:12 +0300
>> 
>> > +  for (--i; i >= 0; --i) {
>> 
>> Please, "i--" is more canonical in for() loops.
>> 
>> > +  for (--i; i >= 0; --i) {
>> 
>> Likewise.
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
> Hi Dave,
> 
> For the "for" loop initial value, "i" should be decremented before doing any
> for-loop calculations (and it is not at all obvious if this is the ordering 
> if we use
> i--, and not --i).  Using --i in the initial value makes the ordering obvious.
> However, I do agree with respect to the increment that --i and i-- are 
> logically
> identical.
> 
> Thus, the "for" loop could read:
>       for (--i; i >= 0; i--) {
> 
> However, my own personal opinion is that this is a bit confusing.
> I would prefer to leave these lines as they are.
> 
> Is that OK with you?

Actually, you should adjust both decrements to read "i--".

Look, if someone doesn't grok that the leftmost decrement happens
before any of the loop body or tests, they don't understand how
for() loops work.

And you're syntax is just confusing people who actually _do_
understand how this part of the C language operates.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to