From: Yury Norov Date: Thu, 8 May 2025 19:32:06 +0000 (-0400) Subject: cgroup/cpuset: drop useless cpumask_empty() in compute_effective_exclusive_cpumask() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=225c0360a8d92636835ca73e3144d78d876bb09c;p=users%2Fdwmw2%2Flinux.git cgroup/cpuset: drop useless cpumask_empty() in compute_effective_exclusive_cpumask() Empty cpumasks can't intersect with any others. Therefore, testing for non-emptyness is useless. Signed-off-by: Yury Norov Reviewed-by: Waiman Long Signed-off-by: Tejun Heo --- diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index d0143b3dce47e..2a95bd6fe5922 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -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++; }