linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpumask: add a few comments of cpumask functions
@ 2012-05-28  9:02 Alex Shi
  2012-05-28 12:47 ` Srivatsa S. Bhat
  0 siblings, 1 reply; 15+ messages in thread
From: Alex Shi @ 2012-05-28  9:02 UTC (permalink / raw)
  To: alex.shi, rusty
  Cc: akpm, paul.gortmaker, kosaki.motohiro, srivatsa.bhat,
	linux-kernel

Current few cpumask function purpose are not quite clear. Stupid
user like myself need to dig into details for clear function
purpose and return value.
Add few explanation for them is helpful.

Signed-off-by: Alex Shi <alex.shi@intel.com>
---
 include/linux/cpumask.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index a2c819d..8436e61 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -271,6 +271,7 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
  * cpumask_test_cpu - test for a cpu in a cpumask
  * @cpu: cpu number (< nr_cpu_ids)
  * @cpumask: the cpumask pointer
+ * return 1 if the 'cpu' is in the old 'cpumask', otherwise return 0
  *
  * No static inline type checking - see Subtlety (1) above.
  */
@@ -281,6 +282,7 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
  * cpumask_test_and_set_cpu - atomically test and set a cpu in a cpumask
  * @cpu: cpu number (< nr_cpu_ids)
  * @cpumask: the cpumask pointer
+ * return 1 if the 'cpu' is in the old 'cpumask', otherwise return 0
  *
  * test_and_set_bit wrapper for cpumasks.
  */
@@ -293,6 +295,7 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
  * cpumask_test_and_clear_cpu - atomically test and clear a cpu in a cpumask
  * @cpu: cpu number (< nr_cpu_ids)
  * @cpumask: the cpumask pointer
+ * return 1 if the 'cpu' is in the old 'cpumask', otherwise return 0
  *
  * test_and_clear_bit wrapper for cpumasks.
  */
@@ -324,6 +327,7 @@ static inline void cpumask_clear(struct cpumask *dstp)
  * @dstp: the cpumask result
  * @src1p: the first input
  * @src2p: the second input
+ * if *dstp is empty, return 0, otherwise return 1
  */
 static inline int cpumask_and(struct cpumask *dstp,
 			       const struct cpumask *src1p,
@@ -365,6 +369,7 @@ static inline void cpumask_xor(struct cpumask *dstp,
  * @dstp: the cpumask result
  * @src1p: the first input
  * @src2p: the second input
+ * if *dstp is empty, return 0, otherwise return 1
  */
 static inline int cpumask_andnot(struct cpumask *dstp,
 				  const struct cpumask *src1p,
@@ -414,6 +419,7 @@ static inline bool cpumask_intersects(const struct cpumask *src1p,
  * cpumask_subset - (*src1p & ~*src2p) == 0
  * @src1p: the first input
  * @src2p: the second input
+ * return 1 if the *src1p is the subset of *src2p, otherwise return 0
  */
 static inline int cpumask_subset(const struct cpumask *src1p,
 				 const struct cpumask *src2p)
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-07-16  8:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28  9:02 [PATCH] cpumask: add a few comments of cpumask functions Alex Shi
2012-05-28 12:47 ` Srivatsa S. Bhat
2012-05-28 13:49   ` Alex Shi
2012-05-28 14:23     ` Alex Shi
2012-07-13 22:37       ` Andrew Morton
2012-07-16  2:34         ` Alex Shi
2012-07-16  7:35           ` Rusty Russell
2012-07-16  8:01             ` Alex Shi
2012-05-28 15:25     ` Srivatsa S. Bhat
2012-05-29  1:16       ` Alex Shi
2012-05-30 10:40         ` Alex Shi
2012-05-30 10:49           ` KOSAKI Motohiro
2012-05-31  8:15             ` Alex Shi
2012-06-04  1:37               ` Rusty Russell
2012-06-04  1:36     ` Rusty Russell

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).