Re: [RFC][PATCH 23/24] atomic: Collapse all atomic_{set,clear}_mask definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 10, 2015 at 11:10:33AM +0200, Geert Uytterhoeven wrote:
> Hi Peter,
> 
> On Thu, Jul 9, 2015 at 7:29 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > --- a/include/linux/atomic.h
> > +++ b/include/linux/atomic.h
> > @@ -28,6 +28,23 @@ static inline int atomic_add_unless(atom
> >  #define atomic_inc_not_zero(v)         atomic_add_unless((v), 1, 0)
> >  #endif
> >
> > +#ifndef atomic_nand
> > +static inline void atomic_nand(int i, atomic_t *v)
> > +{
> > +       atomic_and(~i, v);
> 
> That sounds like a misnomer...
> 
> Your NAND is "A & ~B", while my[*] NAND is "~(A & B)"?
> 
> [*] https://en.wikipedia.org/wiki/NAND_logic

Right you are.

> What about atomic_clear()? (Is atomic_bic() too ARM-centric?)

atomic_and_not() ?
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux