linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] locking/refcounts: Remove refcount_sub() extern
@ 2017-07-01 18:01 Kees Cook
  2017-07-02  9:28 ` [tip:locking/core] locking/refcount: Remove the half-implemented refcount_sub() API tip-bot for Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2017-07-01 18:01 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Josh Poimboeuf, Elena Reshetova, linux-kernel

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")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
This should be applied to locking/core for -next, please.
---
 include/linux/refcount.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index 099c32bd07b2..c31579bcf1fe 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);
 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);
-- 
2.7.4


-- 
Kees Cook
Pixel Security

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:locking/core] locking/refcount: Remove the half-implemented refcount_sub() API
  2017-07-01 18:01 [PATCH] locking/refcounts: Remove refcount_sub() extern Kees Cook
@ 2017-07-02  9:28 ` tip-bot for Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Kees Cook @ 2017-07-02  9:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: keescook, linux-kernel, hpa, peterz, jpoimboe, tglx, mingo,
	torvalds, elena.reshetova

Commit-ID:  5d6dec6fba38c3e2d408df108bb92ef4ac201f18
Gitweb:     http://git.kernel.org/tip/5d6dec6fba38c3e2d408df108bb92ef4ac201f18
Author:     Kees Cook <keescook@chromium.org>
AuthorDate: Sat, 1 Jul 2017 11:01:29 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
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.

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>
---
 include/linux/refcount.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index bb71f28..591792c 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);
 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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-02  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-01 18:01 [PATCH] locking/refcounts: Remove refcount_sub() extern Kees Cook
2017-07-02  9:28 ` [tip:locking/core] locking/refcount: Remove the half-implemented refcount_sub() API tip-bot for Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).