summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2019-03-15 16:33:15 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2019-03-28 00:08:12 +0100
commitc4ee2d41138e92bbaef4389ebfd03cd855613b32 (patch)
tree2fdc20c6529ec213d79279983261305e6d5a1584
parent00adae7f1e9d5ec504e839726bb4c6c3e7be339c (diff)
backport: add atomic_fetch_add_unless()
The iwlwifi driver now needs this function. Backport it. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r--backport/backport-include/linux/atomic.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/backport/backport-include/linux/atomic.h b/backport/backport-include/linux/atomic.h
index b4dd2e1d..9ceb586e 100644
--- a/backport/backport-include/linux/atomic.h
+++ b/backport/backport-include/linux/atomic.h
@@ -51,4 +51,13 @@
#endif /* atomic_try_cmpxchg_acquire */
+#if LINUX_VERSION_IS_LESS(4,19,0)
+#ifndef atomic_fetch_add_unless
+static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u)
+{
+ return __atomic_add_unless(v, a, u);
+}
+#endif
+#endif
+
#endif /* __BP_ATOMIC_H */