From: Donatas Abraitis Date: Mon, 4 Oct 2021 16:26:39 +0000 (+0300) Subject: tests: Do not explicitly set the thread pointer to NULL X-Git-Tag: frr-8.2.2~425^2~2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;ds=sidebyside;h=feabd51dae76a1a85913b2d5b9cea95bc720eadc;p=mirror_frr.git tests: Do not explicitly set the thread pointer to NULL FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donatas Abraitis --- diff --git a/tests/lib/test_timer_correctness.c b/tests/lib/test_timer_correctness.c index 416ea3977..0ae9761b1 100644 --- a/tests/lib/test_timer_correctness.c +++ b/tests/lib/test_timer_correctness.c @@ -134,7 +134,6 @@ int main(int argc, char **argv) /* Schedule timers to expire in 0..5 seconds */ interval_msec = prng_rand(prng) % 5000; arg = XMALLOC(MTYPE_TMP, TIMESTR_LEN + 1); - timers[i] = NULL; thread_add_timer_msec(master, timer_func, arg, interval_msec, &timers[i]); ret = snprintf(arg, TIMESTR_LEN + 1, "%lld.%06lld", diff --git a/tests/lib/test_timer_performance.c b/tests/lib/test_timer_performance.c index 45b29b92b..23c044c7c 100644 --- a/tests/lib/test_timer_performance.c +++ b/tests/lib/test_timer_performance.c @@ -55,7 +55,6 @@ int main(int argc, char **argv) /* create thread structures so they won't be allocated during the * time measurement */ for (i = 0; i < SCHEDULE_TIMERS; i++) { - timers[i] = NULL; thread_add_timer_msec(master, dummy_func, NULL, 0, &timers[i]); } for (i = 0; i < SCHEDULE_TIMERS; i++) @@ -67,7 +66,6 @@ int main(int argc, char **argv) long interval_msec; interval_msec = prng_rand(prng) % (100 * SCHEDULE_TIMERS); - timers[i] = NULL; thread_add_timer_msec(master, dummy_func, NULL, interval_msec, &timers[i]); }