Skip to content

Commit

Permalink
batman-adv: make batadv_tt_save_orig_buffer() generic
Browse files Browse the repository at this point in the history
This is a simple batadv_tt_save_orig_buffer() refactoring
aiming to make it more generic and avoid useless casts.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
  • Loading branch information
Antonio Quartulli authored and Antonio Quartulli committed Oct 12, 2013
1 parent 298e6e6 commit e8cf234
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
struct batadv_orig_node *orig_node,
const unsigned char *tt_buff,
uint16_t tt_num_changes)
const void *tt_buff,
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
* last OGM (the OGM could carry no changes)
*/
Expand Down Expand Up @@ -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,
tt_num_changes, ttvn);

batadv_tt_save_orig_buffer(bat_priv, orig_node,
(unsigned char *)tt_change, tt_num_changes);
batadv_tt_save_orig_buffer(bat_priv, orig_node, tt_change,
batadv_tt_len(tt_num_changes));
atomic_set(&orig_node->last_ttvn, ttvn);
}

Expand Down

0 comments on commit e8cf234

Please sign in to comment.