Skip to content

Commit

Permalink
use config_set only for boolean config values
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lsf37 committed Jun 17, 2024
1 parent 2587dda commit 488887a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/sel4test-tests/src/tests/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
2 changes: 1 addition & 1 deletion apps/sel4test-tests/src/tests/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 488887a

Please sign in to comment.