diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2020-10-12 08:35:18 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2020-10-12 08:35:18 -0400 |
| commit | 28ef0ee121aa93399d8684a59d6ca66ee07ade84 (patch) | |
| tree | 0ed63f8466ec87119c32a0af40e490aa89c6622d /lib/ldp_sync.c | |
| parent | 8b6b6b694d7c5ae8193e0c9a3907b9143df44a07 (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 'lib/ldp_sync.c')
| -rw-r--r-- | lib/ldp_sync.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/ldp_sync.c b/lib/ldp_sync.c index 5dd045d88d..9657f0b1df 100644 --- a/lib/ldp_sync.c +++ b/lib/ldp_sync.c @@ -79,10 +79,8 @@ bool ldp_sync_if_down(struct ldp_sync_info *ldp_sync_info) * update state */ if (ldp_sync_info && ldp_sync_info->enabled == LDP_IGP_SYNC_ENABLED) { - 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); + if (ldp_sync_info->state == LDP_IGP_SYNC_STATE_REQUIRED_UP) ldp_sync_info->state = LDP_IGP_SYNC_STATE_REQUIRED_NOT_UP; |
