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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 16 Mar 2017 09:41:10 -0700 Andi Kleen <ak@xxxxxxxxxxxxxxx> wrote:

> > 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);

That was me fixing rejects (from
asm-generic-x86-wrap-atomic-operations.patch), incompletely.

--- a/arch/x86/include/asm/atomic.h~x86-atomic-move-__atomic_add_unless-out-of-line-fix
+++ a/arch/x86/include/asm/atomic.h
@@ -235,6 +235,8 @@ ATOMIC_OPS(xor, ^)
 #undef ATOMIC_FETCH_OP
 #undef ATOMIC_OP
 
+int __arch_atomic_add_unless(atomic_t *v, int a, int u);
+
 /**
  * arch_atomic_inc_short - increment of a short integer
  * @v: pointer to type int

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux