[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0907030942260.3210@localhost.localdomain>
Date: Fri, 3 Jul 2009 09:47:00 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: mingo@...hat.com, hpa@...or.com, paulus@...ba.org, acme@...hat.com,
linux-kernel@...r.kernel.org, eric.dumazet@...il.com,
a.p.zijlstra@...llo.nl, efault@....de, arnd@...db.de,
fweisbec@...il.com, dhowells@...hat.com, akpm@...ux-foundation.org,
tglx@...utronix.de, mingo@...e.hu
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists