lkml.org 
[lkml]   [2020]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v6 66/80] locking/refcount: document the new "oldp" pointer value
Date
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@kernel.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
\
 
 \ /
  Last update: 2020-10-13 14:03    [W:0.618 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site