summaryrefslogtreecommitdiff
path: root/include/linux/atomic.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-06 05:57:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-06 05:57:19 -0400
commit1bb025f6db789ea0bb674eaed15ee843ef0b2e88 (patch)
treecdbaa7f57ce541abb5b973803712a9f55307c355 /include/linux/atomic.h
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff)
parentf75587b8ca69768c6cf8a38a0b61e68e1bea3d36 (diff)
downloadlinux-1bb025f6db789ea0bb674eaed15ee843ef0b2e88.tar.gz
linux-1bb025f6db789ea0bb674eaed15ee843ef0b2e88.tar.xz
Merge tag 'extcon-fixes-for-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-linus
Chanwoo writes: Update extcon for v4.6-rc3 This patch fixes the following one issue: - In extcon-palmas.c, the external abort happen when wake-up from suspend state on BeagleBoard-X15 platform. So, drop the IRQF_EARLY_RESUME flag.
Diffstat (limited to 'include/linux/atomic.h')
-rw-r--r--include/linux/atomic.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
index df4f369254c0..506c3531832e 100644
--- a/include/linux/atomic.h
+++ b/include/linux/atomic.h
@@ -559,25 +559,25 @@ static inline int atomic_dec_if_positive(atomic_t *v)
#endif
/**
- * fetch_or - perform *ptr |= mask and return old value of *ptr
- * @ptr: pointer to value
- * @mask: mask to OR on the value
- *
- * cmpxchg based fetch_or, macro so it works for different integer types
+ * atomic_fetch_or - perform *p |= mask and return old value of *p
+ * @p: pointer to atomic_t
+ * @mask: mask to OR on the atomic_t
*/
-#ifndef fetch_or
-#define fetch_or(ptr, mask) \
-({ typeof(*(ptr)) __old, __val = *(ptr); \
- for (;;) { \
- __old = cmpxchg((ptr), __val, __val | (mask)); \
- if (__old == __val) \
- break; \
- __val = __old; \
- } \
- __old; \
-})
-#endif
+#ifndef atomic_fetch_or
+static inline int atomic_fetch_or(atomic_t *p, int mask)
+{
+ int old, val = atomic_read(p);
+
+ for (;;) {
+ old = atomic_cmpxchg(p, val, val | mask);
+ if (old == val)
+ break;
+ val = old;
+ }
+ return old;
+}
+#endif
#ifdef CONFIG_GENERIC_ATOMIC64
#include <asm-generic/atomic64.h>