Skip to content

Commit 5d6dec6

Browse files
keesingomolnar
authored andcommitted
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: 29dee3c ("locking/refcounts: Out-of-line everything") Link: http://lkml.kernel.org/r/20170701180129.GA17405@beast Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent fd25d19 commit 5d6dec6

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

‎include/linux/refcount.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ extern __must_check bool refcount_inc_not_zero(refcount_t *r);
4949
extern void refcount_inc(refcount_t *r);
5050

5151
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);
5352

5453
extern __must_check bool refcount_dec_and_test(refcount_t *r);
5554
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
7978
return atomic_sub_and_test(i, &r->refs);
8079
}
8180

82-
static inline void refcount_sub(unsigned int i, refcount_t *r)
83-
{
84-
atomic_sub(i, &r->refs);
85-
}
86-
8781
static inline __must_check bool refcount_dec_and_test(refcount_t *r)
8882
{
8983
return atomic_dec_and_test(&r->refs);

0 commit comments

Comments
 (0)