[tip:perfcounters/urgent] x86: atomic64: Clean up atomic64_sub_and_test() and atomic64_add_negative()
From: tip-bot for Ingo Molnar
Date: Fri Jul 03 2009 - 15:19:34 EST
Commit-ID: ddf9a003d32f720805ac30bcc15755e9289073de
Gitweb: http://git.kernel.org/tip/ddf9a003d32f720805ac30bcc15755e9289073de
Author: Ingo Molnar <mingo@xxxxxxx>
AuthorDate: Fri, 3 Jul 2009 20:11:30 +0200
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Fri, 3 Jul 2009 21:15:08 +0200
x86: atomic64: Clean up atomic64_sub_and_test() and atomic64_add_negative()
Linus noticed that the variable name 'old_val' is
confusingly named in these functions - the correct
naming is 'new_val'.
Reported-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Eric Dumazet <eric.dumazet@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: David Howells <dhowells@xxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
LKML-Reference: <alpine.LFD.2.01.0907030942260.3210@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
arch/x86/lib/atomic64_32.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/lib/atomic64_32.c b/arch/x86/lib/atomic64_32.c
index a804f96..1d98c9e 100644
--- a/arch/x86/lib/atomic64_32.c
+++ b/arch/x86/lib/atomic64_32.c
@@ -175,9 +175,9 @@ EXPORT_SYMBOL(atomic64_sub);
*/
int atomic64_sub_and_test(u64 delta, atomic64_t *ptr)
{
- u64 old_val = atomic64_sub_return(delta, ptr);
+ u64 new_val = atomic64_sub_return(delta, ptr);
- return old_val == 0;
+ return new_val == 0;
}
EXPORT_SYMBOL(atomic64_sub_and_test);
@@ -244,8 +244,8 @@ EXPORT_SYMBOL(atomic64_inc_and_test);
*/
int atomic64_add_negative(u64 delta, atomic64_t *ptr)
{
- long long old_val = atomic64_add_return(delta, ptr);
+ s64 new_val = atomic64_add_return(delta, ptr);
- return old_val < 0;
+ return new_val < 0;
}
EXPORT_SYMBOL(atomic64_add_negative);
--
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/