[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <157466995143.21853.13899787853537407464.tip-bot2@tip-bot2>
Date: Mon, 25 Nov 2019 08:19:11 -0000
From: "tip-bot2 for Will Deacon" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Will Deacon <will@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
Kees Cook <keescook@...omium.org>,
Hanjun Guo <guohanjun@...wei.com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Elena Reshetova <elena.reshetova@...el.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: locking/core] locking/refcount: Consolidate
REFCOUNT_{MAX,SATURATED} definitions
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 65b008552469f1c37f5e06e0016924502e40b4f5
Gitweb: https://git.kernel.org/tip/65b008552469f1c37f5e06e0016924502e40b4f5
Author: Will Deacon <will@...nel.org>
AuthorDate: Thu, 21 Nov 2019 11:58:59
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Mon, 25 Nov 2019 09:15:27 +01:00
locking/refcount: Consolidate REFCOUNT_{MAX,SATURATED} definitions
The definitions of REFCOUNT_MAX and REFCOUNT_SATURATED are the same,
regardless of CONFIG_REFCOUNT_FULL, so consolidate them into a single
pair of definitions.
Signed-off-by: Will Deacon <will@...nel.org>
Reviewed-by: Ard Biesheuvel <ardb@...nel.org>
Reviewed-by: Kees Cook <keescook@...omium.org>
Tested-by: Hanjun Guo <guohanjun@...wei.com>
Cc: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc: Elena Reshetova <elena.reshetova@...el.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: https://lkml.kernel.org/r/20191121115902.2551-8-will@kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
include/linux/refcount.h | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index 1cd0a87..757d463 100644
--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -22,6 +22,8 @@ typedef struct refcount_struct {
} refcount_t;
#define REFCOUNT_INIT(n) { .refs = ATOMIC_INIT(n), }
+#define REFCOUNT_MAX INT_MAX
+#define REFCOUNT_SATURATED (INT_MIN / 2)
enum refcount_saturation_type {
REFCOUNT_ADD_NOT_ZERO_OVF,
@@ -57,9 +59,6 @@ static inline unsigned int refcount_read(const refcount_t *r)
#ifdef CONFIG_REFCOUNT_FULL
#include <linux/bug.h>
-#define REFCOUNT_MAX INT_MAX
-#define REFCOUNT_SATURATED (INT_MIN / 2)
-
/*
* Variant of atomic_t specialized for reference counts.
*
@@ -300,10 +299,6 @@ static inline void refcount_dec(refcount_t *r)
refcount_warn_saturate(r, REFCOUNT_DEC_LEAK);
}
#else /* CONFIG_REFCOUNT_FULL */
-
-#define REFCOUNT_MAX INT_MAX
-#define REFCOUNT_SATURATED (INT_MIN / 2)
-
# ifdef CONFIG_ARCH_HAS_REFCOUNT
# include <asm/refcount.h>
# else
Powered by blists - more mailing lists