summaryrefslogtreecommitdiffstats
path: root/include/linux/cpumask.h
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@intel.com>2012-05-28 10:23:51 -0400
committerRusty Russell <rusty@rustcorp.com.au>2012-07-26 19:59:40 -0400
commitc777ad69185de908a0d571abbaec117392b3ad1b (patch)
treee7473b0863f39171c6c64cd73ef63ad8d642e92e /include/linux/cpumask.h
parent84a1caf1453c3d44050bd22db958af4a7f99315c (diff)
cpumask: add a few comments of cpumask functions
Current few cpumask functions' purposes are not quite clear. Stupid user like myself needs to dig into details for clear function purpose and return value. Add few explanation for them is helpful. Thanks for Srivatsa's comments and correction! Signed-off-by: Alex Shi <alex.shi@intel.com> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/cpumask.h')
-rw-r--r--include/linux/cpumask.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index a2c819d3c96e..8bf1c275fce3 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -272,6 +272,8 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
272 * @cpu: cpu number (< nr_cpu_ids) 272 * @cpu: cpu number (< nr_cpu_ids)
273 * @cpumask: the cpumask pointer 273 * @cpumask: the cpumask pointer
274 * 274 *
275 * Returns 1 if @cpu is set in @cpumask, else returns 0
276 *
275 * No static inline type checking - see Subtlety (1) above. 277 * No static inline type checking - see Subtlety (1) above.
276 */ 278 */
277#define cpumask_test_cpu(cpu, cpumask) \ 279#define cpumask_test_cpu(cpu, cpumask) \
@@ -282,6 +284,8 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
282 * @cpu: cpu number (< nr_cpu_ids) 284 * @cpu: cpu number (< nr_cpu_ids)
283 * @cpumask: the cpumask pointer 285 * @cpumask: the cpumask pointer
284 * 286 *
287 * Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0
288 *
285 * test_and_set_bit wrapper for cpumasks. 289 * test_and_set_bit wrapper for cpumasks.
286 */ 290 */
287static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) 291static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
@@ -294,6 +298,8 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
294 * @cpu: cpu number (< nr_cpu_ids) 298 * @cpu: cpu number (< nr_cpu_ids)
295 * @cpumask: the cpumask pointer 299 * @cpumask: the cpumask pointer
296 * 300 *
301 * Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0
302 *
297 * test_and_clear_bit wrapper for cpumasks. 303 * test_and_clear_bit wrapper for cpumasks.
298 */ 304 */
299static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask) 305static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
@@ -324,6 +330,8 @@ static inline void cpumask_clear(struct cpumask *dstp)
324 * @dstp: the cpumask result 330 * @dstp: the cpumask result
325 * @src1p: the first input 331 * @src1p: the first input
326 * @src2p: the second input 332 * @src2p: the second input
333 *
334 * If *@dstp is empty, returns 0, else returns 1
327 */ 335 */
328static inline int cpumask_and(struct cpumask *dstp, 336static inline int cpumask_and(struct cpumask *dstp,
329 const struct cpumask *src1p, 337 const struct cpumask *src1p,
@@ -365,6 +373,8 @@ static inline void cpumask_xor(struct cpumask *dstp,
365 * @dstp: the cpumask result 373 * @dstp: the cpumask result
366 * @src1p: the first input 374 * @src1p: the first input
367 * @src2p: the second input 375 * @src2p: the second input
376 *
377 * If *@dstp is empty, returns 0, else returns 1
368 */ 378 */
369static inline int cpumask_andnot(struct cpumask *dstp, 379static inline int cpumask_andnot(struct cpumask *dstp,
370 const struct cpumask *src1p, 380 const struct cpumask *src1p,
@@ -414,6 +424,8 @@ static inline bool cpumask_intersects(const struct cpumask *src1p,
414 * cpumask_subset - (*src1p & ~*src2p) == 0 424 * cpumask_subset - (*src1p & ~*src2p) == 0
415 * @src1p: the first input 425 * @src1p: the first input
416 * @src2p: the second input 426 * @src2p: the second input
427 *
428 * Returns 1 if *@src1p is a subset of *@src2p, else returns 0
417 */ 429 */
418static inline int cpumask_subset(const struct cpumask *src1p, 430static inline int cpumask_subset(const struct cpumask *src1p,
419 const struct cpumask *src2p) 431 const struct cpumask *src2p)