[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b233b8d610fae376472d0ef4e43b256efb69bdfa.1602589096.git.mchehab+huawei@kernel.org>
Date: Tue, 13 Oct 2020 13:54:21 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Linux Doc Mailing List <linux-doc@...r.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
"Jonathan Corbet" <corbet@....net>,
Ard Biesheuvel <ardb@...nel.org>,
Ingo Molnar <mingo@...nel.org>, Jann Horn <jannh@...gle.com>,
Kees Cook <keescook@...omium.org>,
Peter Zijlstra <peterz@...radead.org>,
Will Deacon <will@...nel.org>, linux-kernel@...r.kernel.org
Subject: [PATCH v6 66/80] locking/refcount: document the new "oldp" pointer value
Changeset a435b9a14356 ("locking/refcount: Provide __refcount API to obtain the old value")
added a new parameter to most refcount functions, but didn't update
the kernel-doc markups.
Add a description for it on all touched functions.
Fixes: a435b9a14356 ("locking/refcount: Provide __refcount API to obtain the old value")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
include/linux/refcount.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index 0e3ee25eb156..24c343bed889 100644
--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -151,6 +151,7 @@ static inline unsigned int refcount_read(const refcount_t *r)
* refcount_add_not_zero - add a value to a refcount unless it is 0
* @i: the value to add to the refcount
* @r: the refcount
+ * @oldp: if not NULL, stores the previous value of the refcount
*
* Will saturate at REFCOUNT_SATURATED and WARN.
*
@@ -184,6 +185,7 @@ static inline __must_check bool refcount_add_not_zero(int i, refcount_t *r)
* refcount_add - add a value to a refcount
* @i: the value to add to the refcount
* @r: the refcount
+ * @oldp: if not NULL, stores the previous value of the refcount
*
* Similar to atomic_add(), but will saturate at REFCOUNT_SATURATED and WARN.
*
@@ -209,6 +211,7 @@ static inline void refcount_add(int i, refcount_t *r)
/**
* refcount_inc_not_zero - increment a refcount unless it is 0
* @r: the refcount to increment
+ * @oldp: if not NULL, stores the previous value of the refcount
*
* Similar to atomic_inc_not_zero(), but will saturate at REFCOUNT_SATURATED
* and WARN.
@@ -227,6 +230,7 @@ static inline __must_check bool refcount_inc_not_zero(refcount_t *r)
/**
* refcount_inc - increment a refcount
* @r: the refcount to increment
+ * @oldp: if not NULL, stores the previous value of the refcount
*
* Similar to atomic_inc(), but will saturate at REFCOUNT_SATURATED and WARN.
*
@@ -245,6 +249,7 @@ static inline void refcount_inc(refcount_t *r)
* refcount_sub_and_test - subtract from a refcount and test if it is 0
* @i: amount to subtract from the refcount
* @r: the refcount
+ * @oldp: if not NULL, stores the previous value of the refcount
*
* Similar to atomic_dec_and_test(), but it will WARN, return false and
* ultimately leak on underflow and will fail to decrement when saturated
@@ -279,6 +284,7 @@ static inline __must_check bool refcount_sub_and_test(int i, refcount_t *r)
/**
* refcount_dec_and_test - decrement a refcount and test if it is 0
* @r: the refcount
+ * @oldp: if not NULL, stores the previous value of the refcount
*
* Similar to atomic_dec_and_test(), it will WARN on underflow and fail to
* decrement when saturated at REFCOUNT_SATURATED.
@@ -297,6 +303,7 @@ static inline __must_check bool refcount_dec_and_test(refcount_t *r)
/**
* refcount_dec - decrement a refcount
* @r: the refcount
+ * @oldp: if not NULL, stores the previous value of the refcount
*
* Similar to atomic_dec(), it will WARN on underflow and fail to decrement
* when saturated at REFCOUNT_SATURATED.
--
2.26.2
Powered by blists - more mailing lists