Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1570455
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() |
| Date | 2017-01-31 08:40 +0100 |
| Message-ID | <t5BcJ-6lb-7@gated-at.bofh.it> (permalink) |
| References | <t5pbA-7p2-35@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
* Fabian Frederick <fabf@skynet.be> wrote:
> complementary definition to atomic_inc_not_zero() featured in
> lib/fault-inject.c
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> 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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Fabian Frederick <fabf@skynet.be> - 2017-01-30 19:50 +0100
Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Ingo Molnar <mingo@kernel.org> - 2017-01-31 08:40 +0100
Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Peter Zijlstra <peterz@infradead.org> - 2017-01-31 11:50 +0100
Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Fabian Frederick <fabf@skynet.be> - 2017-01-31 18:50 +0100
Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Peter Zijlstra <peterz@infradead.org> - 2017-01-31 20:20 +0100
Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Fabian Frederick <fabf@skynet.be> - 2017-01-31 22:00 +0100
Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Peter Zijlstra <peterz@infradead.org> - 2017-02-01 10:30 +0100
Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Fabian Frederick <fabf@skynet.be> - 2017-02-01 20:30 +0100
csiph-web