From 03340748debc0e9e39373f229e92560ffd0e03da Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Fri, 19 Dec 2025 10:10:08 +0100 Subject: [PATCH] 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. --- src/cpu_topo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu_topo.c b/src/cpu_topo.c index f853fe693..2a2966cd4 100644 --- a/src/cpu_topo.c +++ b/src/cpu_topo.c @@ -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++; } -- 2.47.3