[PATCH RFC batadv 08/12] batman-adv: tt: replace add_orig_entry goto in batadv_tt_global_add()
Sven Eckelmann <[email protected]>
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <[email protected]> |
The "add_orig_entry" label was only used to skip the flag merging of the non-temporary path. Which means that the code jumping to it and the code below it are the two halves of an if/else. Both halves now only decide whether the originator list has to be purged, so turn them into an if/else and purge the list at a single place. Signed-off-by: Sven Eckelmann <[email protected]> --- net/batman-adv/translation-table.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 71d9fcf6..17a92ff4 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -2073,15 +2073,16 @@ static bool batadv_tt_global_add(struct batadv_priv *bat_priv, if (batadv_tt_global_entry_has_orig(tt_global_entry, orig_node, NULL)) goto out_remove; - batadv_tt_global_del_orig_list(tt_global_entry); - goto add_orig_entry; + + delete = true; + } else { + delete = batadv_tt_global_merge_flags(tt_global_entry, flags); } - delete = batadv_tt_global_merge_flags(tt_global_entry, flags); if (delete) batadv_tt_global_del_orig_list(tt_global_entry); } -add_orig_entry: + /* add the new orig_entry (if needed) or update it */ batadv_tt_global_orig_entry_add(tt_global_entry, orig_node, ttvn, flags & BATADV_TT_SYNC_MASK); -- 2.47.3