From e02d24bab3c650620849fc1e8e0cd849a190f704 Mon Sep 17 00:00:00 2001 From: Gerwin Klein Date: Fri, 10 Mar 2023 09:23:04 +1100 Subject: [PATCH] use config_set only for boolean config values config_set is true for 1 and false for all other values, so it does not make sense to use with CONFIG_MAX_NUM_NODES. The two instances where this happened look like they are trying to guard CONFIG_MAX_NUM_NODES > 1 by checking whether CONFIG_MAX_NUM_NODES has any value at all, but doing so incorrectly. CONFIG_MAX_NUM_NODES has a default value of 1 and should always be set to a number, so we can just drop the guard. If this assumption about always having a numbers value is wrong, the code will not compile, which is acceptable. Signed-off-by: Gerwin Klein --- apps/sel4test-tests/src/tests/fpu.c | 2 +- apps/sel4test-tests/src/tests/ipc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sel4test-tests/src/tests/fpu.c b/apps/sel4test-tests/src/tests/fpu.c index bafad72b..5e167bb4 100644 --- a/apps/sel4test-tests/src/tests/fpu.c +++ b/apps/sel4test-tests/src/tests/fpu.c @@ -187,4 +187,4 @@ int smp_test_fpu(env_t env) return sel4test_get_result(); } DEFINE_TEST(FPU0002, "Test FPU remain valid across core migration", smp_test_fpu, - config_set(CONFIG_MAX_NUM_NODES) &&config_set(CONFIG_HAVE_TIMER) &&CONFIG_MAX_NUM_NODES > 1) + config_set(CONFIG_HAVE_TIMER) &&(CONFIG_MAX_NUM_NODES > 1)) diff --git a/apps/sel4test-tests/src/tests/ipc.c b/apps/sel4test-tests/src/tests/ipc.c index d34b9e3d..ffd0512b 100644 --- a/apps/sel4test-tests/src/tests/ipc.c +++ b/apps/sel4test-tests/src/tests/ipc.c @@ -1362,5 +1362,5 @@ static int test_sched_donation_cross_core(env_t env) return sel4test_get_result(); } DEFINE_TEST(IPC0028, "Cross core sched donation", test_sched_donation_cross_core, - config_set(CONFIG_KERNEL_MCS) &&config_set(CONFIG_MAX_NUM_NODES) &&CONFIG_MAX_NUM_NODES > 1); + config_set(CONFIG_KERNEL_MCS) &&(CONFIG_MAX_NUM_NODES > 1)); #endif /* CONFIG_KERNEL_MCS */