| Date | Fri, 3 Jul 2009 09:47:00 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [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
|