summaryrefslogtreecommitdiff
path: root/isisd/isis_ldp_sync.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-10-12 08:35:18 -0400
committerDonald Sharp <sharpd@nvidia.com>2020-10-12 08:35:18 -0400
commit28ef0ee121aa93399d8684a59d6ca66ee07ade84 (patch)
tree0ed63f8466ec87119c32a0af40e490aa89c6622d /isisd/isis_ldp_sync.c
parent8b6b6b694d7c5ae8193e0c9a3907b9143df44a07 (diff)
*: Use proper semantics for turning off thread
We have this pattern in the code base: if (thread) THREAD_OFF(thread); If we look at THREAD_OFF we check to see if thread is non-null too. So we have a double check. This is unnecessary. Convert to just using THREAD_OFF Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'isisd/isis_ldp_sync.c')
-rw-r--r--isisd/isis_ldp_sync.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/isisd/isis_ldp_sync.c b/isisd/isis_ldp_sync.c
index c15b59a8cf..8360dfc59e 100644
--- a/isisd/isis_ldp_sync.c
+++ b/isisd/isis_ldp_sync.c
@@ -300,10 +300,7 @@ void isis_ldp_sync_ldp_fail(struct isis_circuit *circuit)
if (ldp_sync_info &&
ldp_sync_info->enabled == LDP_IGP_SYNC_ENABLED &&
ldp_sync_info->state != LDP_IGP_SYNC_STATE_NOT_REQUIRED) {
- if (ldp_sync_info->t_holddown != NULL) {
- THREAD_TIMER_OFF(ldp_sync_info->t_holddown);
- ldp_sync_info->t_holddown = NULL;
- }
+ THREAD_TIMER_OFF(ldp_sync_info->t_holddown);
ldp_sync_info->state = LDP_IGP_SYNC_STATE_REQUIRED_NOT_UP;
isis_ldp_sync_set_if_metric(circuit, true);
}
@@ -326,8 +323,7 @@ void isis_ldp_sync_if_remove(struct isis_circuit *circuit, bool remove)
ils_debug("ldp_sync: remove if %s", circuit->interface
? circuit->interface->name : "");
- if (ldp_sync_info->t_holddown)
- THREAD_TIMER_OFF(ldp_sync_info->t_holddown);
+ THREAD_TIMER_OFF(ldp_sync_info->t_holddown);
ldp_sync_info->state = LDP_IGP_SYNC_STATE_NOT_REQUIRED;
isis_ldp_sync_set_if_metric(circuit, true);
if (remove) {