aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2013-05-05 13:32:38 -0400
committerAntonio Quartulli <antonio@meshcoding.com>2013-10-12 03:51:27 -0400
commit1e5d49fce3f16bfeac02c4ad3821be0665f66a33 (patch)
tree8b5468a23f662c40ab47b11b47620c841ce20380 /net
parent97dbc03b4776fbcfda99c4486357d28115d9adc0 (diff)
batman-adv: make tt_global_add static and return bool
batadv_tt_global_add is not used anymore outside of the TT code thanks to the TVLV implementation. It can therefore be declared as static Last user has been removed by 3de4e64df0f1326db7cc0ef25f5af8522850252d ("batman-adv: tvlv - convert roaming adv packet to use tvlv unicast packets") Moreover make it return bool since its result can be either 0 or 1. Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/translation-table.c14
-rw-r--r--net/batman-adv/translation-table.h4
2 files changed, 8 insertions, 10 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index c7416947a4e0..b3c43691bc6c 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -805,15 +805,17 @@ out:
805 * If a TT local entry exists for this non-mesh client remove it. 805 * If a TT local entry exists for this non-mesh client remove it.
806 * 806 *
807 * The caller must hold orig_node refcount. 807 * The caller must hold orig_node refcount.
808 *
809 * Return true if the new entry has been added, false otherwise
808 */ 810 */
809int batadv_tt_global_add(struct batadv_priv *bat_priv, 811static bool batadv_tt_global_add(struct batadv_priv *bat_priv,
810 struct batadv_orig_node *orig_node, 812 struct batadv_orig_node *orig_node,
811 const unsigned char *tt_addr, uint16_t flags, 813 const unsigned char *tt_addr, uint16_t flags,
812 uint8_t ttvn) 814 uint8_t ttvn)
813{ 815{
814 struct batadv_tt_global_entry *tt_global_entry; 816 struct batadv_tt_global_entry *tt_global_entry;
815 struct batadv_tt_local_entry *tt_local_entry; 817 struct batadv_tt_local_entry *tt_local_entry;
816 int ret = 0; 818 bool ret = false;
817 int hash_added; 819 int hash_added;
818 struct batadv_tt_common_entry *common; 820 struct batadv_tt_common_entry *common;
819 uint16_t local_flags; 821 uint16_t local_flags;
@@ -914,7 +916,7 @@ add_orig_entry:
914 batadv_dbg(BATADV_DBG_TT, bat_priv, 916 batadv_dbg(BATADV_DBG_TT, bat_priv,
915 "Creating new global tt entry: %pM (via %pM)\n", 917 "Creating new global tt entry: %pM (via %pM)\n",
916 common->addr, orig_node->orig); 918 common->addr, orig_node->orig);
917 ret = 1; 919 ret = true;
918 920
919out_remove: 921out_remove:
920 922
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h
index b4b6dea4e2be..fb710c5199c9 100644
--- a/net/batman-adv/translation-table.h
+++ b/net/batman-adv/translation-table.h
@@ -30,10 +30,6 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset);
30void batadv_tt_global_add_orig(struct batadv_priv *bat_priv, 30void batadv_tt_global_add_orig(struct batadv_priv *bat_priv,
31 struct batadv_orig_node *orig_node, 31 struct batadv_orig_node *orig_node,
32 const unsigned char *tt_buff, int tt_buff_len); 32 const unsigned char *tt_buff, int tt_buff_len);
33int batadv_tt_global_add(struct batadv_priv *bat_priv,
34 struct batadv_orig_node *orig_node,
35 const unsigned char *addr, uint16_t flags,
36 uint8_t ttvn);
37int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset); 33int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset);
38void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, 34void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
39 struct batadv_orig_node *orig_node, 35 struct batadv_orig_node *orig_node,