From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752243AbdGBJdf (ORCPT ); Sun, 2 Jul 2017 05:33:35 -0400 Received: from terminus.zytor.com ([65.50.211.136]:36683 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751717AbdGBJdd (ORCPT ); Sun, 2 Jul 2017 05:33:33 -0400 Date: Sun, 2 Jul 2017 02:28:02 -0700 From: tip-bot for Kees Cook Message-ID: Cc: keescook@chromium.org, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, jpoimboe@redhat.com, tglx@linutronix.de, mingo@kernel.org, torvalds@linux-foundation.org, elena.reshetova@intel.com Reply-To: jpoimboe@redhat.com, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, elena.reshetova@intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org, keescook@chromium.org, hpa@zytor.com In-Reply-To: <20170701180129.GA17405@beast> References: <20170701180129.GA17405@beast> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/refcount: Remove the half-implemented refcount_sub() API Git-Commit-ID: 5d6dec6fba38c3e2d408df108bb92ef4ac201f18 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 5d6dec6fba38c3e2d408df108bb92ef4ac201f18 Gitweb: http://git.kernel.org/tip/5d6dec6fba38c3e2d408df108bb92ef4ac201f18 Author: Kees Cook AuthorDate: Sat, 1 Jul 2017 11:01:29 -0700 Committer: Ingo Molnar 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 Cc: Elena Reshetova Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: 29dee3c03abc ("locking/refcounts: Out-of-line everything") Link: http://lkml.kernel.org/r/20170701180129.GA17405@beast Signed-off-by: Ingo Molnar --- 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);