lkml.org 
[lkml]   [2010]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: x86: A fast way to check capabilities of the current cpu
    On 12/15/2010 12:56 PM, Andrew Morton wrote:
    > On Wed, 15 Dec 2010 14:07:39 -0600 (CST)
    > Christoph Lameter <cl@linux.com> 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
    >

    Not if b is not a bool.

    -hpa



    \
     
     \ /
      Last update: 2010-12-15 22:07    [W:0.047 / U:91.480 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site