Commit 8864d2fc authored by Yu Zhe's avatar Yu Zhe Committed by Simon Wunderlich

batman-adv: remove unnecessary type castings

remove unnecessary void* type castings.
Signed-off-by: default avatarYu Zhe <yuzhe@nfschina.com>
[sven@narfation.org: Fix missing const in batadv_choose* functions]
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
parent cfa4e7b1
...@@ -65,7 +65,7 @@ batadv_bla_send_announce(struct batadv_priv *bat_priv, ...@@ -65,7 +65,7 @@ batadv_bla_send_announce(struct batadv_priv *bat_priv,
*/ */
static inline u32 batadv_choose_claim(const void *data, u32 size) static inline u32 batadv_choose_claim(const void *data, u32 size)
{ {
struct batadv_bla_claim *claim = (struct batadv_bla_claim *)data; const struct batadv_bla_claim *claim = data;
u32 hash = 0; u32 hash = 0;
hash = jhash(&claim->addr, sizeof(claim->addr), hash); hash = jhash(&claim->addr, sizeof(claim->addr), hash);
...@@ -86,7 +86,7 @@ static inline u32 batadv_choose_backbone_gw(const void *data, u32 size) ...@@ -86,7 +86,7 @@ static inline u32 batadv_choose_backbone_gw(const void *data, u32 size)
const struct batadv_bla_backbone_gw *gw; const struct batadv_bla_backbone_gw *gw;
u32 hash = 0; u32 hash = 0;
gw = (struct batadv_bla_backbone_gw *)data; gw = data;
hash = jhash(&gw->orig, sizeof(gw->orig), hash); hash = jhash(&gw->orig, sizeof(gw->orig), hash);
hash = jhash(&gw->vid, sizeof(gw->vid), hash); hash = jhash(&gw->vid, sizeof(gw->vid), hash);
......
...@@ -103,10 +103,10 @@ static bool batadv_compare_tt(const struct hlist_node *node, const void *data2) ...@@ -103,10 +103,10 @@ static bool batadv_compare_tt(const struct hlist_node *node, const void *data2)
*/ */
static inline u32 batadv_choose_tt(const void *data, u32 size) static inline u32 batadv_choose_tt(const void *data, u32 size)
{ {
struct batadv_tt_common_entry *tt; const struct batadv_tt_common_entry *tt;
u32 hash = 0; u32 hash = 0;
tt = (struct batadv_tt_common_entry *)data; tt = data;
hash = jhash(&tt->addr, ETH_ALEN, hash); hash = jhash(&tt->addr, ETH_ALEN, hash);
hash = jhash(&tt->vid, sizeof(tt->vid), hash); hash = jhash(&tt->vid, sizeof(tt->vid), hash);
...@@ -2766,7 +2766,7 @@ static void batadv_tt_tvlv_generate(struct batadv_priv *bat_priv, ...@@ -2766,7 +2766,7 @@ static void batadv_tt_tvlv_generate(struct batadv_priv *bat_priv,
u32 i; u32 i;
tt_tot = batadv_tt_entries(tt_len); tt_tot = batadv_tt_entries(tt_len);
tt_change = (struct batadv_tvlv_tt_change *)tvlv_buff; tt_change = tvlv_buff;
if (!valid_cb) if (!valid_cb)
return; return;
...@@ -3994,7 +3994,7 @@ static void batadv_tt_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv, ...@@ -3994,7 +3994,7 @@ static void batadv_tt_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
if (tvlv_value_len < sizeof(*tt_data)) if (tvlv_value_len < sizeof(*tt_data))
return; return;
tt_data = (struct batadv_tvlv_tt_data *)tvlv_value; tt_data = tvlv_value;
tvlv_value_len -= sizeof(*tt_data); tvlv_value_len -= sizeof(*tt_data);
num_vlan = ntohs(tt_data->num_vlan); num_vlan = ntohs(tt_data->num_vlan);
...@@ -4037,7 +4037,7 @@ static int batadv_tt_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv, ...@@ -4037,7 +4037,7 @@ static int batadv_tt_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv,
if (tvlv_value_len < sizeof(*tt_data)) if (tvlv_value_len < sizeof(*tt_data))
return NET_RX_SUCCESS; return NET_RX_SUCCESS;
tt_data = (struct batadv_tvlv_tt_data *)tvlv_value; tt_data = tvlv_value;
tvlv_value_len -= sizeof(*tt_data); tvlv_value_len -= sizeof(*tt_data);
tt_vlan_len = sizeof(struct batadv_tvlv_tt_vlan_data); tt_vlan_len = sizeof(struct batadv_tvlv_tt_vlan_data);
...@@ -4129,7 +4129,7 @@ static int batadv_roam_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv, ...@@ -4129,7 +4129,7 @@ static int batadv_roam_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv,
goto out; goto out;
batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX); batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX);
roaming_adv = (struct batadv_tvlv_roam_adv *)tvlv_value; roaming_adv = tvlv_value;
batadv_dbg(BATADV_DBG_TT, bat_priv, batadv_dbg(BATADV_DBG_TT, bat_priv,
"Received ROAMING_ADV from %pM (client %pM)\n", "Received ROAMING_ADV from %pM (client %pM)\n",
......
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