Skip to contentSkip to conversation

locking/refcounts: Remove refcount_sub() extern

PATCH New Kees Cook 2 participants 2 messages Jul 1, 2017 – Jul 2, 2017 Atomic infrastructure

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 locking/refcounts: Remove refcount_sub() extern

CONFIG_REFCOUNT_FULL (correctly) did not provide a refcount_sub(), which should not be part of proper refcount design patterns. This removes the erroneous extern (and the later non-FULL accidental implementation).

Fixes 29dee3c03abc ("locking/refcounts: Out-of-line everything")

---
This should be applied to locking/core for -next, please.

---
 include/linux/refcount.h | 6 ------
 1 file changed, 6 deletions(-)
include/linux/refcount.h +0 -6
index 099c32bd07b2..c31579bcf1fe 100644
@@ -49,7 +49,6 @@ extern __must_check bool refcount_inc_not_zero(refcount_t *r);
 extern void refcount_inc(refcount_t *r);
 
 extern __must_check bool refcount_sub_and_test(unsigned int i, refcount_t *r);
-extern void refcount_sub(unsigned int i, refcount_t *r);
 
 extern __must_check bool refcount_dec_and_test(refcount_t *r);
 extern void refcount_dec(refcount_t *r);
@@ -81,11 +80,6 @@ static inline __must_check bool refcount_sub_and_test(unsigned int i,
 	return atomic_sub_and_test(i, &r->refs);
 }
 
-static inline void refcount_sub(unsigned int i, refcount_t *r)
-{
-	atomic_sub(i, &r->refs);
-}
-
 static inline __must_check bool refcount_dec_and_test(refcount_t *r)
 {
 	return atomic_dec_and_test(&r->refs);
Signature · 6 lines
2.7.4


-- 
Kees Cook
Pixel Security
#1 lore raw

[tip:locking/core] locking/refcount: Remove the half-implemented refcount_sub() API

locking/refcount: Remove the half-implemented refcount_sub() API
Commit-ID:  5d6dec6fba38c3e2d408df108bb92ef4ac201f18
Gitweb:     http://git.kernel.org/tip/5d6dec6fba38c3e2d408df108bb92ef4ac201f18
Author:     Kees Cook <[email protected]>
AuthorDate: Sat, 1 Jul 2017 11:01:29 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sun, 2 Jul 2017 11:24:36 +0200

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.

Cc Elena Reshetova <[email protected]>
Cc Josh Poimboeuf <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Fixes 29dee3c03abc ("locking/refcounts: Out-of-line everything")
---
 include/linux/refcount.h | 6 ------
 1 file changed, 6 deletions(-)
include/linux/refcount.h +0 -6
index bb71f28..591792c 100644
@@ -49,7 +49,6 @@ extern __must_check bool refcount_inc_not_zero(refcount_t *r);
 extern void refcount_inc(refcount_t *r);
 
 extern __must_check bool refcount_sub_and_test(unsigned int i, refcount_t *r);
-extern void refcount_sub(unsigned int i, refcount_t *r);
 
 extern __must_check bool refcount_dec_and_test(refcount_t *r);
 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
 	return atomic_sub_and_test(i, &r->refs);
 }
 
-static inline void refcount_sub(unsigned int i, refcount_t *r)
-{
-	atomic_sub(i, &r->refs);
-}
-
 static inline __must_check bool refcount_dec_and_test(refcount_t *r)
 {
 	return atomic_dec_and_test(&r->refs);