Re: [PATCH for 3.12] mutex: Avoid gcc version dependent__builtin_constant_p() usage.

From: Peter Zijlstra
Date: Thu Oct 17 2013 - 06:53:12 EST


On Thu, Oct 17, 2013 at 07:45:29PM +0900, Tetsuo Handa wrote:
> Commit 040a0a37 "mutex: Add support for wound/wait style locks" used
> "!__builtin_constant_p(p == NULL)" but gcc 3.x cannot handle such expression
> correctly, leading to boot failure when built with CONFIG_DEBUG_MUTEXES=y.

So I completely forgot all about this, but wouldn't something like:

!(__builtin_constant_p(p) && p == NULL)

Not also work and generate the same code?
--
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/