Re: [RFC patch 0/4] TSC calibration improvements

From: Linus Torvalds
Date: Sat Sep 06 2008 - 17:11:10 EST




On Sat, 6 Sep 2008, Thomas Gleixner wrote:
>
> Where is a guarantee, that excpect is not decremented before we break
> out of the loop ?

Quite the reverse. We have a guarantee that it _is_ decremented.

Adn that guarantee is very much about the C language.

for (a ; b ; c) {
..
}

translates as

a;
while (b) {
..
continue:
c;
}

And this has absolutely _nothing_ to do with any gcc oddity or anything
else.

The fact is, the code that Ingo added was totally bogus. The real bug was
that he did a totally bogus "--expect" in the argument to that last call.

Because 'c' *will* have been done after the last iteration of the loop.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/