Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero()

2017-02-01 Thread Fabian Frederick
> On 01 February 2017 at 10:25 Peter Zijlstra wrote: > > > On Tue, Jan 31, 2017 at 09:55:08PM +0100, Fabian Frederick wrote: > > Once again it's just about readability: > > I feel APIs should be about common use-cases, not about sporadic weird cases. > > > "add -1 unless value is zero" looks mor

Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero()

2017-02-01 Thread Peter Zijlstra
On Tue, Jan 31, 2017 at 09:55:08PM +0100, Fabian Frederick wrote: > Once again it's just about readability: I feel APIs should be about common use-cases, not about sporadic weird cases. > "add -1 unless value is zero" looks more complex in code than "dec not zero" > but maybe it's just a matter o

Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero()

2017-01-31 Thread Fabian Frederick
> On 31 January 2017 at 20:17 Peter Zijlstra wrote: > > > On Tue, Jan 31, 2017 at 06:41:28PM +0100, Fabian Frederick wrote: > > > > > > > On 31 January 2017 at 11:41 Peter Zijlstra wrote: > > > > > > > > > On Mon, Jan 30, 2017 at 07:39:38PM +0100, Fabian Frederick wrote: > > > > complementary d

Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero()

2017-01-31 Thread Peter Zijlstra
On Tue, Jan 31, 2017 at 06:41:28PM +0100, Fabian Frederick wrote: > > > > On 31 January 2017 at 11:41 Peter Zijlstra wrote: > > > > > > On Mon, Jan 30, 2017 at 07:39:38PM +0100, Fabian Frederick wrote: > > > complementary definition to atomic_inc_not_zero() featured in > > > lib/fault-inject.c >

Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero()

2017-01-31 Thread Fabian Frederick
> On 31 January 2017 at 11:41 Peter Zijlstra wrote: > > > On Mon, Jan 30, 2017 at 07:39:38PM +0100, Fabian Frederick wrote: > > complementary definition to atomic_inc_not_zero() featured in > > lib/fault-inject.c > > Why? Maybe this commit message should be ok ? complementary definition to ato

Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero()

2017-01-31 Thread Peter Zijlstra
On Mon, Jan 30, 2017 at 07:39:38PM +0100, Fabian Frederick wrote: > complementary definition to atomic_inc_not_zero() featured in > lib/fault-inject.c Why?

Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero()

2017-01-30 Thread Ingo Molnar
* Fabian Frederick wrote: > complementary definition to atomic_inc_not_zero() featured in > lib/fault-inject.c > > Signed-off-by: Fabian Frederick > --- > include/linux/atomic.h | 2 ++ > lib/fault-inject.c | 2 -- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/inclu

[PATCH 01/14] locking/atomic: import atomic_dec_not_zero()

2017-01-30 Thread Fabian Frederick
complementary definition to atomic_inc_not_zero() featured in lib/fault-inject.c Signed-off-by: Fabian Frederick --- include/linux/atomic.h | 2 ++ lib/fault-inject.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/atomic.h b/include/linux/atomic.h index