Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1602648

Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error

From Andi Kleen <ak@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
Date 2017-03-16 17:50 +0100
Message-ID <tlGL8-14c-21@gated-at.bofh.it> (permalink)
References <tlvwl-1oS-3@gated-at.bofh.it> <tlyXg-3YD-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> Andi, why did you completely remove __arch_atomic_add_unless() from
> the header? Don't we need at least a declaration there?

Actually it's there in my git version:

I wonder where it disappeared.

-/**
- * __atomic_add_unless - add unless the number is already a given value
- * @v: pointer of type atomic_t
- * @a: the amount to add to v...
- * @u: ...unless v is equal to u.
- *
- * Atomically adds @a to @v, so long as @v was not already @u.
- * Returns the old value of @v.
- */
-static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u)
-{
-       int c, old;
-       c = atomic_read(v);
-       for (;;) {
-               if (unlikely(c == (u)))
-                       break;
-               old = atomic_cmpxchg((v), c, c + (a));
-               if (likely(old == c))
-                       break;
-               c = old;
-       }
-       return c;
-}
+int __atomic_add_unless(atomic_t *v, int a, int u);

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[mmotm] "x86/atomic: move __arch_atomic_add_unless out of line"  build error Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-03-16 05:50 +0100
  Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line"  build error Dmitry Vyukov <dvyukov@google.com> - 2017-03-16 09:30 +0100
    Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line"  build error Andi Kleen <ak@linux.intel.com> - 2017-03-16 17:30 +0100
    Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line"  build error Andi Kleen <ak@linux.intel.com> - 2017-03-16 17:50 +0100
      Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line"  build error Andrew Morton <akpm@linux-foundation.org> - 2017-03-16 19:50 +0100

csiph-web