BUG/MINOR: cpu-topo: fix -Wlogical-not-parentheses build with clang

src/cpu_topo.c:1325:15: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
 1325 |                         } else if (!cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE)
      |                                    ^                      ~
src/cpu_topo.c:1325:15: note: add parentheses after the '!' to evaluate the bitwise operator first
 1325 |                         } else if (!cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE)
      |                                    ^
      |                                     (                                                     )
src/cpu_topo.c:1325:15: note: add parentheses around left hand side expression to silence this warning
 1325 |                         } else if (!cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE)
      |                                    ^
      |                                    (                     )
src/cpu_topo.c:1533:15: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
 1533 |                         } else if (!cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE)
      |                                    ^                      ~
src/cpu_topo.c:1533:15: note: add parentheses after the '!' to evaluate the bitwise operator first
 1533 |                         } else if (!cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE)
      |                                    ^
      |                                     (                                                     )
src/cpu_topo.c:1533:15: note: add parentheses around left hand side expression to silence this warning
 1533 |                         } else if (!cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE)
      |                                    ^
      |                                    (                     )

No backport needed.
This commit is contained in:
William Lallemand 2025-12-19 10:10:08 +01:00
parent 8aef5bec1e
commit 03340748de

View File

@ -1322,7 +1322,7 @@ static int cpu_policy_group_by_cluster(int policy, int tmin, int tmax, int gmin,
if (!ha_cpuset_isset(&visited_tsid, ha_cpu_topo[cpu].ts_id)) {
cpu_count++;
ha_cpuset_set(&visited_tsid, ha_cpu_topo[cpu].ts_id);
} else if (!cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE)
} else if (!(cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE))
cpu_count++;
}
@ -1530,7 +1530,7 @@ static int cpu_policy_group_by_ccx(int policy, int tmin, int tmax, int gmin, int
if (!ha_cpuset_isset(&visited_tsid, ha_cpu_topo[cpu].ts_id)) {
cpu_count++;
ha_cpuset_set(&visited_tsid, ha_cpu_topo[cpu].ts_id);
} else if (!cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE)
} else if (!(cpu_policy_conf.flags & CPU_POLICY_ONE_THREAD_PER_CORE))
cpu_count++;
}