]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cgroup/cpuset: drop useless cpumask_empty() in compute_effective_exclusive_cpumask()
authorYury Norov <yury.norov@gmail.com>
Thu, 8 May 2025 19:32:06 +0000 (15:32 -0400)
committerTejun Heo <tj@kernel.org>
Fri, 9 May 2025 17:32:19 +0000 (07:32 -1000)
Empty cpumasks can't intersect with any others. Therefore, testing for
non-emptyness is useless.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cpuset.c

index d0143b3dce47e0c3cabdfe8210e794c25ba272b5..2a95bd6fe592210a6fc4913bbec21126efb39ac0 100644 (file)
@@ -1402,14 +1402,12 @@ static int compute_effective_exclusive_cpumask(struct cpuset *cs,
                if (sibling == cs)
                        continue;
 
-               if (!cpumask_empty(sibling->exclusive_cpus) &&
-                   cpumask_intersects(xcpus, sibling->exclusive_cpus)) {
+               if (cpumask_intersects(xcpus, sibling->exclusive_cpus)) {
                        cpumask_andnot(xcpus, xcpus, sibling->exclusive_cpus);
                        retval++;
                        continue;
                }
-               if (!cpumask_empty(sibling->effective_xcpus) &&
-                   cpumask_intersects(xcpus, sibling->effective_xcpus)) {
+               if (cpumask_intersects(xcpus, sibling->effective_xcpus)) {
                        cpumask_andnot(xcpus, xcpus, sibling->effective_xcpus);
                        retval++;
                }