[v2,14/16] ipsec: use previous value atomic fetch operations
Checks
Commit Message
Use __atomic_fetch_{add,and,or,sub,xor} instead of
__atomic_{add,and,or,sub,xor}_fetch adding the necessary code to
allow consumption of the resulting value.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/ipsec/ipsec_sqn.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -128,7 +128,7 @@
n = *num;
if (SQN_ATOMIC(sa))
- sqn = __atomic_add_fetch(&sa->sqn.outb, n, __ATOMIC_RELAXED);
+ sqn = __atomic_fetch_add(&sa->sqn.outb, n, __ATOMIC_RELAXED) + n;
else {
sqn = sa->sqn.outb + n;
sa->sqn.outb = sqn;