Re: [PATCH v2 2/2] locking/atomic/x86: Introduce arch_try_cmpxchg64

From: Peter Zijlstra
Date: Fri May 13 2022 - 18:18:56 EST


On Fri, May 13, 2022 at 05:30:09PM +0200, Uros Bizjak wrote:


> +#define arch_try_cmpxchg64(ptr, po, n) \
> + ((__typeof__(*(ptr)))__try_cmpxchg64((ptr), (unsigned long long *)(po), \
> + (unsigned long long)(n)))

That doesn't look right (unless it's so late I really can't read
anymore, in which case ignore me and I'll try again on monday). But the
return value of try_cmpxchg is bool, not typeof(*ptr).