Skip to content

Commit

Permalink
x86: atomic64: Clean up atomic64_sub_and_test() and atomic64_add_nega…
Browse files Browse the repository at this point in the history
…tive()

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>
  • Loading branch information
Ingo Molnar committed Jul 3, 2009
1 parent 3a8d178 commit ddf9a00
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/x86/lib/atomic64_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

0 comments on commit ddf9a00

Please sign in to comment.