Merge branch 'locking/atomics' into locking/core, to pick up WIP commits
[sfrench/cifs-2.6.git] / scripts / atomic / fallbacks / try_cmpxchg
1 cat <<EOF
2 static inline bool
3 ${atomic}_try_cmpxchg${order}(${atomic}_t *v, ${int} *old, ${int} new)
4 {
5         ${int} r, o = *old;
6         r = ${atomic}_cmpxchg${order}(v, o, new);
7         if (unlikely(r != o))
8                 *old = r;
9         return likely(r == o);
10 }
11 EOF