Re: [tip:locking/core] locking/atomics: Simplify the op definitions in atomic.h some more

From: Peter Zijlstra
Date: Tue May 15 2018 - 14:15:24 EST


On Tue, May 15, 2018 at 08:11:36PM +0200, Peter Zijlstra wrote:
> On Tue, May 15, 2018 at 06:53:08PM +0100, Mark Rutland wrote:

> > > > # name meta args...
> > > > #
> > > > # Where meta contains a string of:
> > > > # * B - bool: returns bool, fully ordered
> > > > # * V - void: returns void, fully ordered
> > > > # * I - int: returns base type, all orderings
> > > > # * R - return: returns base type, all orderings
> > > > # * F - fetch: returns base type, all orderings
> > > > # * T - try: returns bool, all orderings
> > >
> > > Little more verbose than mine, I think we can get there with X and XB
> > > instead of I and T, but whatever :-)
> >
> > Mhmm. I found it easier to do switch-like things this way, but it works
> > regardless.
>
> I'm a minimalist, but yeah whatever ;-)

Although; by having X we only have a single I. You currently have I as
meta and argument type, which is prone to confusion or something.

Alternatively we could use 'p' for the argument pointer thing.

> > > > # Where args contains list of type[:name], where type is:
> > > > # * v - pointer to atomic base type (atomic or atomic64)
> > > > # * i - base type (int or long)
> > > > # * I - pointer to base type (int or long)
> > > > #