aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/translation-table.c
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-09-23 16:38:36 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-11-14 15:00:36 -0500
commitbe73b488d1e2993fe92b5ec02347c3f7c08307b8 (patch)
treed7413fa72c5b097b8e05e00b8fa1b5d2d5199beb /net/batman-adv/translation-table.c
parent47c94655c3d8086d92825760e1f1d9b12a5976e4 (diff)
batman-adv: refactor tt_global_del_struct()
batadv_tt_global_del_struct() function is not properly named. Having a more meaningful name which reflects the current behavior helps other developers to easily understand what it does. A parameter has also been renamed in order to let the function header better fit the 80-chars line-width Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r--net/batman-adv/translation-table.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index c24e60425289..cb8433aceed8 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -927,18 +927,17 @@ batadv_tt_global_del_orig_entry(struct batadv_priv *bat_priv,
927 spin_unlock_bh(&tt_global_entry->list_lock); 927 spin_unlock_bh(&tt_global_entry->list_lock);
928} 928}
929 929
930static void 930static void batadv_tt_global_free(struct batadv_priv *bat_priv,
931batadv_tt_global_del_struct(struct batadv_priv *bat_priv, 931 struct batadv_tt_global_entry *tt_global,
932 struct batadv_tt_global_entry *tt_global_entry, 932 const char *message)
933 const char *message)
934{ 933{
935 batadv_dbg(BATADV_DBG_TT, bat_priv, 934 batadv_dbg(BATADV_DBG_TT, bat_priv,
936 "Deleting global tt entry %pM: %s\n", 935 "Deleting global tt entry %pM: %s\n",
937 tt_global_entry->common.addr, message); 936 tt_global->common.addr, message);
938 937
939 batadv_hash_remove(bat_priv->tt.global_hash, batadv_compare_tt, 938 batadv_hash_remove(bat_priv->tt.global_hash, batadv_compare_tt,
940 batadv_choose_orig, tt_global_entry->common.addr); 939 batadv_choose_orig, tt_global->common.addr);
941 batadv_tt_global_entry_free_ref(tt_global_entry); 940 batadv_tt_global_entry_free_ref(tt_global);
942 941
943} 942}
944 943
@@ -1002,8 +1001,8 @@ static void batadv_tt_global_del(struct batadv_priv *bat_priv,
1002 orig_node, message); 1001 orig_node, message);
1003 1002
1004 if (hlist_empty(&tt_global_entry->orig_list)) 1003 if (hlist_empty(&tt_global_entry->orig_list))
1005 batadv_tt_global_del_struct(bat_priv, tt_global_entry, 1004 batadv_tt_global_free(bat_priv, tt_global_entry,
1006 message); 1005 message);
1007 1006
1008 goto out; 1007 goto out;
1009 } 1008 }
@@ -1026,7 +1025,7 @@ static void batadv_tt_global_del(struct batadv_priv *bat_priv,
1026 if (local_entry) { 1025 if (local_entry) {
1027 /* local entry exists, case 2: client roamed to us. */ 1026 /* local entry exists, case 2: client roamed to us. */
1028 batadv_tt_global_del_orig_list(tt_global_entry); 1027 batadv_tt_global_del_orig_list(tt_global_entry);
1029 batadv_tt_global_del_struct(bat_priv, tt_global_entry, message); 1028 batadv_tt_global_free(bat_priv, tt_global_entry, message);
1030 } else 1029 } else
1031 /* no local entry exists, case 1: check for roaming */ 1030 /* no local entry exists, case 1: check for roaming */
1032 batadv_tt_global_del_roaming(bat_priv, tt_global_entry, 1031 batadv_tt_global_del_roaming(bat_priv, tt_global_entry,