Commit 75ae84a4 authored by Simon Wunderlich's avatar Simon Wunderlich

batman-adv: simplify return handling in some TT functions

Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent 1227c9ae
...@@ -2488,18 +2488,16 @@ static bool ...@@ -2488,18 +2488,16 @@ static bool
_batadv_is_ap_isolated(struct batadv_tt_local_entry *tt_local_entry, _batadv_is_ap_isolated(struct batadv_tt_local_entry *tt_local_entry,
struct batadv_tt_global_entry *tt_global_entry) struct batadv_tt_global_entry *tt_global_entry)
{ {
bool ret = false;
if (tt_local_entry->common.flags & BATADV_TT_CLIENT_WIFI && if (tt_local_entry->common.flags & BATADV_TT_CLIENT_WIFI &&
tt_global_entry->common.flags & BATADV_TT_CLIENT_WIFI) tt_global_entry->common.flags & BATADV_TT_CLIENT_WIFI)
ret = true; return true;
/* check if the two clients are marked as isolated */ /* check if the two clients are marked as isolated */
if (tt_local_entry->common.flags & BATADV_TT_CLIENT_ISOLA && if (tt_local_entry->common.flags & BATADV_TT_CLIENT_ISOLA &&
tt_global_entry->common.flags & BATADV_TT_CLIENT_ISOLA) tt_global_entry->common.flags & BATADV_TT_CLIENT_ISOLA)
ret = true; return true;
return ret; return false;
} }
/** /**
...@@ -4010,8 +4008,6 @@ bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv, ...@@ -4010,8 +4008,6 @@ bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv,
const unsigned char *addr, const unsigned char *addr,
unsigned short vid) unsigned short vid)
{ {
bool ret = false;
/* ignore loop detect macs, they are not supposed to be in the tt local /* ignore loop detect macs, they are not supposed to be in the tt local
* data as well. * data as well.
*/ */
...@@ -4021,14 +4017,13 @@ bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv, ...@@ -4021,14 +4017,13 @@ bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv,
if (!batadv_tt_global_add(bat_priv, orig_node, addr, vid, if (!batadv_tt_global_add(bat_priv, orig_node, addr, vid,
BATADV_TT_CLIENT_TEMP, BATADV_TT_CLIENT_TEMP,
atomic_read(&orig_node->last_ttvn))) atomic_read(&orig_node->last_ttvn)))
goto out; return false;
batadv_dbg(BATADV_DBG_TT, bat_priv, batadv_dbg(BATADV_DBG_TT, bat_priv,
"Added temporary global client (addr: %pM, vid: %d, orig: %pM)\n", "Added temporary global client (addr: %pM, vid: %d, orig: %pM)\n",
addr, batadv_print_vid(vid), orig_node->orig); addr, batadv_print_vid(vid), orig_node->orig);
ret = true;
out: return true;
return ret;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment