lkml.org 
[lkml]   [2009]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [tip:perfcounters/urgent] x86: atomic64: Move the 32-bit atomic64_t implementation to a .c file


    On Fri, 3 Jul 2009, tip-bot for Ingo Molnar wrote:
    > +int atomic64_add_negative(u64 delta, atomic64_t *ptr)
    > +{
    > + long long old_val = atomic64_add_return(delta, ptr);
    > +
    > + return old_val < 0;
    > +}

    Can we please fix this horribly mis-named 'old_val' variable?

    It's not 'old_val'. It should be 'new_val' or 'result'.

    As it is, the above looks very wrong, and made me think that you had done
    the wrong semantics (ie "xadd" like semantics that literally return the
    pre-add 'old' value).

    But on closer inspection, it looks like the code is correct, but the
    naming is just totally wrong.

    Linus


    \
     
     \ /
      Last update: 2009-10-18 23:28    [W:0.040 / U:0.308 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site