[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150710102210.GF19282@twins.programming.kicks-ass.net>
Date: Fri, 10 Jul 2015 12:22:10 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Heiko Carstens <heiko.carstens@...ibm.com>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
rth@...ddle.net, vgupta@...opsys.com, linux@....linux.org.uk,
will.deacon@....com, hskinnemoen@...il.com, realmz6@...il.com,
dhowells@...hat.com, rkuo@...eaurora.org, tony.luck@...el.com,
geert@...ux-m68k.org, james.hogan@...tec.com, ralf@...ux-mips.org,
jejb@...isc-linux.org, benh@...nel.crashing.org,
davem@...emloft.net, cmetcalf@...hip.com, mingo@...nel.org
Subject: Re: [RFC][PATCH 19/24] s390: Provide atomic_{or,xor,and}
On Fri, Jul 10, 2015 at 09:17:09AM +0200, Heiko Carstens wrote:
> > @@ -50,6 +51,7 @@
> > #define __ATOMIC_AND "nr"
> > #define __ATOMIC_ADD "ar"
> > #define __ATOMIC_BARRIER "\n"
> > +#define __ATOMIC_XOR "xr"
>
> Would you mind moving the two XOR define above the BARRIER?
> Just to keep it consistent with ATOMIC64 stuff within this patch ;)
Oh, duh, done.
> > #define __ATOMIC_LOOP(ptr, op_val, op_string, __barrier) \
> > ({ \
> > @@ -118,14 +120,26 @@ static inline void atomic_add(int i, ato
> > #define atomic_dec_return(_v) atomic_sub_return(1, _v)
> > #define atomic_dec_and_test(_v) (atomic_sub_return(1, _v) == 0)
> >
> > -static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
> > +#define ATOMIC_OP(op, OP) \
> > +static inline void atomic_##op(int i, atomic_t *v) \
> > +{ \
> > + __ATOMIC_LOOP(v, i, __ATOMIC_##OP, __ATOMIC_NO_BARRIER); \
> > +}
> > +
> > +ATOMIC_OP(and, AND)
> > +ATOMIC_OP(or, OR)
> > +ATOMIC_OP(xor, XOR)
> > +
> > +#undef ATOMIC_OP
> > +
> > +static inline __deprecated void atomic_clear_mask(unsigned int mask, atomic_t *v)
> > {
> > - __ATOMIC_LOOP(v, ~mask, __ATOMIC_AND, __ATOMIC_NO_BARRIER);
> > + atomic_and(~mask, v);
> > }
> >
> > -static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
> > +static inline __deprecated void atomic_set_mask(unsigned int mask, atomic_t *v)
> > {
> > - __ATOMIC_LOOP(v, mask, __ATOMIC_OR, __ATOMIC_NO_BARRIER);
> > + atomic_or(mask, v);
> > }
>
> If you insist on the __deprecated (no problem with that), I'd like to apply
> your patch to the s390 tree so I can convert all users.
> I would like to avoid to see tons of warnings.
See the last patch in this series, it does that conversion. Although I
might need to double check I got them all, its been a while since I did
that patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists