[LTP] [PATCH v2 2/4] m4: add a check for __sync_add_and_fetch

Cyril Hrubis chrubis@suse.cz
Thu Apr 14 16:33:55 CEST 2016


Hi!
> +#if HAVE_SYNC_ADD_AND_FETCH == 1
> +static inline __attribute__((always_inline)) int atomic_add_return(int i, int *v)

As this is publicly exported interface I would prefer adding tst_ prefix
to the function name.

> +{
> +	return __sync_add_and_fetch(v, i);
> +}
> +#else
> +#error Your compiler does not provide __sync_add_and_fetch and LTP\
> + implementation is missing for your architecture.
> +#endif
> +
>  static inline int tst_atomic_inc(int *v)
>  {
> -	return __sync_add_and_fetch(v, 1);
> +	return atomic_add_return(1, v);
>  }

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list