From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751040AbdAaHed (ORCPT ); Tue, 31 Jan 2017 02:34:33 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35542 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbdAaHe0 (ORCPT ); Tue, 31 Jan 2017 02:34:26 -0500 Date: Tue, 31 Jan 2017 08:33:12 +0100 From: Ingo Molnar To: Fabian Frederick Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Message-ID: <20170131073312.GA11851@gmail.com> References: <20170130183938.12702-1-fabf@skynet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170130183938.12702-1-fabf@skynet.be> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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/include/linux/atomic.h b/include/linux/atomic.h > index e71835b..d8e6551 100644 > --- a/include/linux/atomic.h > +++ b/include/linux/atomic.h > @@ -517,6 +517,8 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) > #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) > #endif > > +#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0) > + > #ifndef atomic_andnot > static inline void atomic_andnot(int i, atomic_t *v) > { > diff --git a/lib/fault-inject.c b/lib/fault-inject.c > index 6a823a5..4ad5dcc 100644 > --- a/lib/fault-inject.c > +++ b/lib/fault-inject.c > @@ -52,8 +52,6 @@ static void fail_dump(struct fault_attr *attr) > } > } > > -#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0) > - Why did you convert the tabs to spaces? Thanks, Ingo