Subject: Re: [PATCH 02/12] Common functions and definitions

From: Stephen Hemminger <[email-masked]>
Date: Mon, 2 Jan 2017 12:00:31 -0800

> +#define AQ_OBJ_SET(_OBJ_, _F_) \
> +{ unsigned long flags_old, flags_new; atomic_t *flags = &(_OBJ_)->flags; \
> +do { \
> +	flags_old = atomic_read(flags); \
> +	flags_new = flags_old | (_F_); \
> +} while (atomic_cmpxchg(flags, \
> +	flags_old, flags_new) != flags_old); }
> +
> +#define AQ_OBJ_CLR(_OBJ_, _F_) \
> +{ unsigned long flags_old, flags_new; atomic_t *flags = &(_OBJ_)->flags; \
> +do { \
> +	flags_old = atomic_read(flags); \
> +	flags_new = flags_old & ~(_F_); \
> +} while (atomic_cmpxchg(flags, \
> +	flags_old, flags_new) != flags_old); }
> +

These are way to complex to be macros. Can't the same logic be done
as inline functions.