File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -413,14 +413,18 @@ unsigned int cpumask_next_wrap(int n, const struct cpumask *src)
413
413
* @cpu: the cpu to ignore.
414
414
*
415
415
* Often used to find any cpu but smp_processor_id() in a mask.
416
+ * If @cpu == -1, the function is equivalent to cpumask_any().
416
417
* Return: >= nr_cpu_ids if no cpus set.
417
418
*/
418
419
static __always_inline
419
- unsigned int cpumask_any_but (const struct cpumask * mask , unsigned int cpu )
420
+ unsigned int cpumask_any_but (const struct cpumask * mask , int cpu )
420
421
{
421
422
unsigned int i ;
422
423
423
- cpumask_check (cpu );
424
+ /* -1 is a legal arg here. */
425
+ if (cpu != -1 )
426
+ cpumask_check (cpu );
427
+
424
428
for_each_cpu (i , mask )
425
429
if (i != cpu )
426
430
break ;
@@ -433,16 +437,20 @@ unsigned int cpumask_any_but(const struct cpumask *mask, unsigned int cpu)
433
437
* @mask2: the second input cpumask
434
438
* @cpu: the cpu to ignore
435
439
*
440
+ * If @cpu == -1, the function is equivalent to cpumask_any_and().
436
441
* Returns >= nr_cpu_ids if no cpus set.
437
442
*/
438
443
static __always_inline
439
444
unsigned int cpumask_any_and_but (const struct cpumask * mask1 ,
440
445
const struct cpumask * mask2 ,
441
- unsigned int cpu )
446
+ int cpu )
442
447
{
443
448
unsigned int i ;
444
449
445
- cpumask_check (cpu );
450
+ /* -1 is a legal arg here. */
451
+ if (cpu != -1 )
452
+ cpumask_check (cpu );
453
+
446
454
i = cpumask_first_and (mask1 , mask2 );
447
455
if (i != cpu )
448
456
return i ;
You can’t perform that action at this time.
0 commit comments