Re: [git pull] x86 fixes

From: Linus Torvalds
Date: Mon Jan 12 2009 - 14:48:19 EST




On Mon, 12 Jan 2009, Pallipadi, Venkatesh wrote:
> + if (strict_prot ||
> + (want_flags == _PAGE_CACHE_UC_MINUS &&
> + flags == _PAGE_CACHE_WB) ||
> + (want_flags == _PAGE_CACHE_WC &&
> + flags == _PAGE_CACHE_WB)) {

Please don't write code like this.

Do it as an inline function that returns true/false and has comments on
what the hell is going on.

If a conditional doesn't fit on one line, it should generally be
abstracted away into a readable function where the name explains what it
does conceptually.

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/