On 6/30/26 11:32, Sayali Patil wrote:
> The KSM selftest uses conditional expressions to skip accesses to
> merge_across_nodes on systems without NUMA support. However, the
> ternary operator is combined with logical OR without parentheses:
>
> a || numa_available() ? 0 : b || c
>
> Due to operator precedence rules, this is parsed as:
>
> (a || numa_available()) ? 0 : (b || c)
>
> instead of the intended:
>
> a || (numa_available() ? 0 : b) || c
>
> Add parentheses around the conditional expressions to ensure the
> correct evaluation order.
>
> Fixes: 9aa1af954db0 ("selftests: vm: check numa_available() before operating
> "merge_across_nodes" in ksm_tests")
> Signed-off-by: Sayali Patil <[email protected]>
> ---
LGTM, although the code is a bit ugly (already before your changes).
Acked-by: David Hildenbrand (Arm) <[email protected]>
--
Cheers,
David