Re: [PATCHv3 07/18] atomics: prepare for atomic64_fetch_add_unless()

From: Mark Rutland
Date: Mon Jun 18 2018 - 12:11:06 EST


On Mon, Jun 18, 2018 at 11:19:08AM +0100, Mark Rutland wrote:
> Currently architecture must implement atomic_fetch_add_unless(), with
> common code providing atomic_add_unless(). Architectures must also
> implement atmic64_add_unless() directly, with no corresponding
> atomic64_fetch_add_unless().
>
> This divergenece is unfortunate, and means that the APIs for atomic_t,
> atomic64_t, and atomic_long_t differ.
>
> In preparation for unifying things, with architectures providing
> atomic64_fetch_add_unless, this patch adds a generic
> atomic64_add_unless() which will use atomic64_fetch_add_unless(). The
> instrumented atomics are updated to take this case into account.

> +#ifdef arch_atomic64_fetch_add_unless
> +#define atomic64_fetch_add_unless atomic64_fetch_add_unless
> +static __always_inline int atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u)

Whoops: s/int/s64/ here

I've fixed that up in my branch.

Thanks,
Mark.