• Ingo Molnar's avatar
    x86: atomic64: Improve atomic64_xchg() · 3a8d1788
    Ingo Molnar authored
    Remove the read-first logic from atomic64_xchg() and simplify
    the loop.
    
    This function was the last user of __atomic64_read() - remove it.
    
    Also, change the 'real_val' assumption from the somewhat quirky
    1ULL << 32 value to the (just as arbitrary, but simpler) value
    of 0.
    Reported-by: default avatarLinus 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: <tip-05118ab8859492ac9ddda0154cf90e37b0a4a0b0@git.kernel.org>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    3a8d1788
atomic_32.h 9.1 KB