3 * ${arch}${atomic}_fetch_add_unless - add unless the number is already a given value
4 * @v: pointer of type ${atomic}_t
5 * @a: the amount to add to v...
6 * @u: ...unless v is equal to u.
8 * Atomically adds @a to @v, so long as @v was not already @u.
9 * Returns original value of @v
11 static __always_inline ${int}
12 ${arch}${atomic}_fetch_add_unless(${atomic}_t *v, ${int} a, ${int} u)
14 ${int} c = ${arch}${atomic}_read(v);
19 } while (!${arch}${atomic}_try_cmpxchg(v, &c, c + a));