From: Kees Cook <keescook@chromium.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Elena Reshetova <elena.reshetova@intel.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] locking/refcounts: Remove refcount_sub() extern
Date: Sat, 1 Jul 2017 11:01:29 -0700 [thread overview]
Message-ID: <20170701180129.GA17405@beast> (raw)
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
next reply other threads:[~2017-07-01 18:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-01 18:01 Kees Cook [this message]
2017-07-02 9:28 ` [tip:locking/core] locking/refcount: Remove the half-implemented refcount_sub() API tip-bot for Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170701180129.GA17405@beast \
--to=keescook@chromium.org \
--cc=elena.reshetova@intel.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).