Re: [tip:perfcounters/urgent] x86: atomic64: Move the 32-bit atomic64_timplementation to a .c file

From: Linus Torvalds
Date: Fri Jul 03 2009 - 12:49:05 EST




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