lkml.org 
[lkml]   [2009]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:perfcounters/urgent] x86: atomic64: Clean up atomic64_sub_and_test() and atomic64_add_negative()
Commit-ID:  0054e925a298829ade45734087f7475e05c2ea1e
Gitweb: http://git.kernel.org/tip/0054e925a298829ade45734087f7475e05c2ea1e
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Fri, 3 Jul 2009 20:11:30 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Jul 2009 20:23:58 +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@linux-foundation.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
LKML-Reference: <alpine.LFD.2.01.0907030942260.3210@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
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 a2dd9a9..d79f4ac 100644
--- a/arch/x86/lib/atomic64_32.c
+++ b/arch/x86/lib/atomic64_32.c
@@ -154,9 +154,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);

@@ -223,8 +223,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);

\
 
 \ /
  Last update: 2009-07-03 20:35    [W:0.089 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site