Commit e8cf234a authored by Antonio Quartulli's avatar Antonio Quartulli Committed by Antonio Quartulli

batman-adv: make batadv_tt_save_orig_buffer() generic

This is a simple batadv_tt_save_orig_buffer() refactoring
aiming to make it more generic and avoid useless casts.
Signed-off-by: default avatarAntonio Quartulli <antonio@open-mesh.com>
Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
parent 298e6e68
...@@ -1496,11 +1496,9 @@ static void batadv_tt_req_list_free(struct batadv_priv *bat_priv) ...@@ -1496,11 +1496,9 @@ static void batadv_tt_req_list_free(struct batadv_priv *bat_priv)
static void batadv_tt_save_orig_buffer(struct batadv_priv *bat_priv, static void batadv_tt_save_orig_buffer(struct batadv_priv *bat_priv,
struct batadv_orig_node *orig_node, struct batadv_orig_node *orig_node,
const unsigned char *tt_buff, const void *tt_buff,
uint16_t tt_num_changes) uint16_t tt_buff_len)
{ {
uint16_t tt_buff_len = batadv_tt_len(tt_num_changes);
/* Replace the old buffer only if I received something in the /* Replace the old buffer only if I received something in the
* last OGM (the OGM could carry no changes) * last OGM (the OGM could carry no changes)
*/ */
...@@ -2037,8 +2035,8 @@ static void batadv_tt_update_changes(struct batadv_priv *bat_priv, ...@@ -2037,8 +2035,8 @@ static void batadv_tt_update_changes(struct batadv_priv *bat_priv,
_batadv_tt_update_changes(bat_priv, orig_node, tt_change, _batadv_tt_update_changes(bat_priv, orig_node, tt_change,
tt_num_changes, ttvn); tt_num_changes, ttvn);
batadv_tt_save_orig_buffer(bat_priv, orig_node, batadv_tt_save_orig_buffer(bat_priv, orig_node, tt_change,
(unsigned char *)tt_change, tt_num_changes); batadv_tt_len(tt_num_changes));
atomic_set(&orig_node->last_ttvn, ttvn); atomic_set(&orig_node->last_ttvn, ttvn);
} }
......
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