mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
batman-adv: tt: drop unnecessary cleanup goto in helpers
To use scoped_guard(), it is not allowed to use goto in the same routine. These goto's should only be used for cleanups but are not necessary of minimal helpers like batadv_is_my_client(), batadv_tt_global_client_is_roaming() and batadv_tt_local_client_is_roaming(). Removing the goto's is actually making these functions more readable. Signed-off-by: Sven Eckelmann <sven@narfation.org>
This commit is contained in:
parent
e103fbefa0
commit
52d8c713f4
|
|
@ -3544,19 +3544,18 @@ bool batadv_is_my_client(struct batadv_priv *bat_priv, const u8 *addr,
|
|||
unsigned short vid)
|
||||
{
|
||||
struct batadv_tt_local_entry *tt_local_entry;
|
||||
bool ret = false;
|
||||
bool ret;
|
||||
|
||||
tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid);
|
||||
if (!tt_local_entry)
|
||||
goto out;
|
||||
return false;
|
||||
|
||||
/* Check if the client has been logically deleted (but is kept for
|
||||
* consistency purpose)
|
||||
*/
|
||||
if ((tt_local_entry->common.flags & BATADV_TT_CLIENT_PENDING) ||
|
||||
(tt_local_entry->common.flags & BATADV_TT_CLIENT_ROAM))
|
||||
goto out;
|
||||
ret = true;
|
||||
out:
|
||||
ret = !((tt_local_entry->common.flags & BATADV_TT_CLIENT_PENDING) ||
|
||||
(tt_local_entry->common.flags & BATADV_TT_CLIENT_ROAM));
|
||||
|
||||
batadv_tt_local_entry_put(tt_local_entry);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -4082,15 +4081,15 @@ bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv,
|
|||
u8 *addr, unsigned short vid)
|
||||
{
|
||||
struct batadv_tt_global_entry *tt_global_entry;
|
||||
bool ret = false;
|
||||
bool ret;
|
||||
|
||||
tt_global_entry = batadv_tt_global_hash_find(bat_priv, addr, vid);
|
||||
if (!tt_global_entry)
|
||||
goto out;
|
||||
return false;
|
||||
|
||||
ret = tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM;
|
||||
batadv_tt_global_entry_put(tt_global_entry);
|
||||
out:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -4108,15 +4107,15 @@ bool batadv_tt_local_client_is_roaming(struct batadv_priv *bat_priv,
|
|||
u8 *addr, unsigned short vid)
|
||||
{
|
||||
struct batadv_tt_local_entry *tt_local_entry;
|
||||
bool ret = false;
|
||||
bool ret;
|
||||
|
||||
tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid);
|
||||
if (!tt_local_entry)
|
||||
goto out;
|
||||
return false;
|
||||
|
||||
ret = tt_local_entry->common.flags & BATADV_TT_CLIENT_ROAM;
|
||||
batadv_tt_local_entry_put(tt_local_entry);
|
||||
out:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user