aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-07-22 03:39:11 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-07-22 03:39:23 +0700
commitac8acc98a3faedd29eb515d6a66426140be4d2c0 (patch)
tree359d55f86aa71c4cff6eb97a55095490cab81679 /tests
parentb41ccb795e37a24169f79e177a00efe9051788af (diff)
call osmo_timer_del() unconditionally, without osmo_timer_pending()
osmo_timer_del() does check if a timer is active internally. Change-Id: I3e42a74d59b8e8d0d46cc4027676149689cc18a3
Diffstat (limited to 'tests')
-rw-r--r--tests/acc/acc_test.c6
-rw-r--r--tests/gsm0408/gsm0408_test.c3
2 files changed, 3 insertions, 6 deletions
diff --git a/tests/acc/acc_test.c b/tests/acc/acc_test.c
index ce3b0cb4d..887e89104 100644
--- a/tests/acc/acc_test.c
+++ b/tests/acc/acc_test.c
@@ -58,10 +58,8 @@ static inline struct gsm_bts *_bts_init(struct gsm_network *net, const char *msg
#define bts_del(bts) _bts_del(bts, __func__)
static inline void _bts_del(struct gsm_bts *bts, const char *msg)
{
- if (osmo_timer_pending(&bts->acc_mgr.rotate_timer))
- osmo_timer_del(&bts->acc_mgr.rotate_timer);
- if (osmo_timer_pending(&bts->acc_ramp.step_timer))
- osmo_timer_del(&bts->acc_ramp.step_timer);
+ osmo_timer_del(&bts->acc_mgr.rotate_timer);
+ osmo_timer_del(&bts->acc_ramp.step_timer);
/* no need to llist_del(&bts->list), we never registered the bts there. */
talloc_free(bts->site_mgr);
fprintf(stderr, "BTS deallocated OK in %s()\n", msg);
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index 03b2ee1d3..999ee805a 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -137,8 +137,7 @@ static inline struct gsm_bts *_bts_init(struct gsm_network *net, const char *msg
#define bts_del(bts) _bts_del(bts, __func__)
static inline void _bts_del(struct gsm_bts *bts, const char *msg)
{
- if (osmo_timer_pending(&bts->acc_mgr.rotate_timer))
- osmo_timer_del(&bts->acc_mgr.rotate_timer);
+ osmo_timer_del(&bts->acc_mgr.rotate_timer);
/* no need to llist_del(&bts->list), we never registered the bts there. */
talloc_free(bts->site_mgr);
printf("BTS deallocated OK in %s()\n", msg);