Re: [PATCH 10/10] atomic.h : Add atomic64 cmpxchg, xchg and add_unless to x86_64

From: Andi Kleen
Date: Mon Feb 12 2007 - 05:35:52 EST


Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx> writes:
>
> /**
> @@ -402,7 +405,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t *v)
> */
> #define atomic_add_unless(v, a, u) \
> ({ \
> - int c, old; \
> + __typeof__((v)->counter) c, old; \

This change seems useless. Please drop.

In general you should enforce atomic_t vs atomic64_t types on x86, otherwise
people will write code that won't compile on other architectures
that have truly different implementations.

I would suggest using inlines.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/