diff options
author | Kees Cook <keescook@chromium.org> | 2017-07-01 14:01:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-07-02 05:24:36 -0400 |
commit | 5d6dec6fba38c3e2d408df108bb92ef4ac201f18 (patch) | |
tree | 55ec5ad38498adac14d05c4a41781113ea8e4f8f | |
parent | fd25d19f6b8da315332bb75936605fb45d3ea981 (diff) |
locking/refcount: Remove the half-implemented refcount_sub() API
CONFIG_REFCOUNT_FULL=y (correctly) does not provide a refcount_sub(),
which should not be part of proper refcount design patterns.
Remove the erroneous extern and the later !CONFIG_REFCOUNT_FULL
accidental implementation.
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 29dee3c03abc ("locking/refcounts: Out-of-line everything")
Link: http://lkml.kernel.org/r/20170701180129.GA17405@beast
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | include/linux/refcount.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/include/linux/refcount.h b/include/linux/refcount.h index bb71f2871dac..591792c8e5b0 100644 --- a/include/linux/refcount.h +++ b/include/linux/refcount.h | |||
@@ -49,7 +49,6 @@ extern __must_check bool refcount_inc_not_zero(refcount_t *r); | |||
49 | extern void refcount_inc(refcount_t *r); | 49 | extern void refcount_inc(refcount_t *r); |
50 | 50 | ||
51 | extern __must_check bool refcount_sub_and_test(unsigned int i, refcount_t *r); | 51 | extern __must_check bool refcount_sub_and_test(unsigned int i, refcount_t *r); |
52 | extern void refcount_sub(unsigned int i, refcount_t *r); | ||
53 | 52 | ||
54 | extern __must_check bool refcount_dec_and_test(refcount_t *r); | 53 | extern __must_check bool refcount_dec_and_test(refcount_t *r); |
55 | extern void refcount_dec(refcount_t *r); | 54 | extern void refcount_dec(refcount_t *r); |
@@ -79,11 +78,6 @@ static inline __must_check bool refcount_sub_and_test(unsigned int i, refcount_t | |||
79 | return atomic_sub_and_test(i, &r->refs); | 78 | return atomic_sub_and_test(i, &r->refs); |
80 | } | 79 | } |
81 | 80 | ||
82 | static inline void refcount_sub(unsigned int i, refcount_t *r) | ||
83 | { | ||
84 | atomic_sub(i, &r->refs); | ||
85 | } | ||
86 | |||
87 | static inline __must_check bool refcount_dec_and_test(refcount_t *r) | 81 | static inline __must_check bool refcount_dec_and_test(refcount_t *r) |
88 | { | 82 | { |
89 | return atomic_dec_and_test(&r->refs); | 83 | return atomic_dec_and_test(&r->refs); |