Skip to content

Commit e876695

Browse files
vax-rYuryNorov
authored andcommitted
cpumask: Rephrase comments for cpumask_any*() APIs
The cpumask_any*() APIs comment states that it returns a "random" cpu within the given cpumask. However it's not actually random as random itself stands a meaning for uniform distribution. cpumask_any*() APIs are a naming convention for the caller to states that it doesn't care which CPU it gets, so change "random" to "arbitrary" would be more appropriate. CC: Mark Rutland <mark.rutland@arm.com> Signed-off-by: I Hsin Cheng <richard120310@gmail.com> Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com> Signed-off-by: Yury Norov <yury.norov@gmail.com>
1 parent 7f15d4a commit e876695

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/linux/cpumask.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int sta
391391
for_each_set_bit_from(cpu, cpumask_bits(mask), small_cpumask_bits)
392392

393393
/**
394-
* cpumask_any_but - return a "random" in a cpumask, but not this one.
394+
* cpumask_any_but - return an arbitrary cpu in a cpumask, but not this one.
395395
* @mask: the cpumask to search
396396
* @cpu: the cpu to ignore.
397397
*
@@ -411,7 +411,7 @@ unsigned int cpumask_any_but(const struct cpumask *mask, unsigned int cpu)
411411
}
412412

413413
/**
414-
* cpumask_any_and_but - pick a "random" cpu from *mask1 & *mask2, but not this one.
414+
* cpumask_any_and_but - pick an arbitrary cpu from *mask1 & *mask2, but not this one.
415415
* @mask1: the first input cpumask
416416
* @mask2: the second input cpumask
417417
* @cpu: the cpu to ignore
@@ -840,15 +840,15 @@ void cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
840840
}
841841

842842
/**
843-
* cpumask_any - pick a "random" cpu from *srcp
843+
* cpumask_any - pick an arbitrary cpu from *srcp
844844
* @srcp: the input cpumask
845845
*
846846
* Return: >= nr_cpu_ids if no cpus set.
847847
*/
848848
#define cpumask_any(srcp) cpumask_first(srcp)
849849

850850
/**
851-
* cpumask_any_and - pick a "random" cpu from *mask1 & *mask2
851+
* cpumask_any_and - pick an arbitrary cpu from *mask1 & *mask2
852852
* @mask1: the first input cpumask
853853
* @mask2: the second input cpumask
854854
*

0 commit comments

Comments
 (0)