[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170102120031.32785d94@xeon-e3>
Date: Mon, 2 Jan 2017 12:00:31 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: David VomLehn <vomlehn@...as.net>
Cc: netdev@...r.kernel.org,
Simon Edelhaus <Simon.Edelhaus@...antia.com>,
Dmitrii Tarakanov <Dmitrii.Tarakanov@...antia.com>,
Alexander Loktionov <Alexander.Loktionov@...antia.com>
Subject: Re: [PATCH 02/12] Common functions and definitions
> +#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.
Powered by blists - more mailing lists