Re: x86: A fast way to check capabilities of the current cpu

From: Andrew Morton
Date: Wed Dec 15 2010 - 15:57:04 EST


On Wed, 15 Dec 2010 14:07:39 -0600 (CST)
Christoph Lameter <cl@xxxxxxxxx> wrote:

> +#define cpu_has(c, bit) \
> + (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
> test_cpu_cap(c, bit))
>
> +#define this_cpu_has(bit) \
> + (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
> + this_cpu_test_bit(bit, (unsigned long *)&cpu_info.x86_capability))
> +

Isn't

a ? 1 : b

a complex way of writing

a || b

?
--
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/