From 872cf299e094913435f5ee5b864712cb70e06c09 Mon Sep 17 00:00:00 2001 From: maqingyu Date: Mon, 21 Oct 2024 07:12:58 +0000 Subject: [PATCH] lib/tntimer: fix compile error in gcc-9 Signed-off-by: maqingyu --- lib/tntimer/tntimer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tntimer/tntimer.c b/lib/tntimer/tntimer.c index 5128b900..939caec8 100644 --- a/lib/tntimer/tntimer.c +++ b/lib/tntimer/tntimer.c @@ -161,10 +161,12 @@ void tn_timer_add(struct timer *in, struct uk_list_head *head) uk_list_add_tail(&in->list, head); update_next_tick: + do { #ifdef CONFIG_LIBTNSYSTICK_TICKLESS - if (in == get_next_timer()) - tn_systick_set_timeout(tn_timer_next_tick()); + if (in == get_next_timer()) + tn_systick_set_timeout(tn_timer_next_tick()); #endif /* CONFIG_LIBTNSYSTICK_TICKLESS */ + }while(0); } void tn_timer_announce(void) -- Gitee