Skip to content

Commit

Permalink
batman-adv: Remove variable deprecated by skb_put_data
Browse files Browse the repository at this point in the history
skb_put_data makes it unnecessary to store the skb_put return value to copy
some data to the packet. The returned pointer of skb_put_data should
therefore not stored by functions which previously only used it to copy
some data.

Signed-off-by: Sven Eckelmann <[email protected]>
Signed-off-by: Simon Wunderlich <[email protected]>
  • Loading branch information
ecsv authored and simonwunderlich committed Jul 29, 2017
1 parent 6a04be8 commit e04de48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions net/batman-adv/bat_iv_ogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,11 +729,9 @@ static void batadv_iv_ogm_aggregate(struct batadv_forw_packet *forw_packet_aggr,
const unsigned char *packet_buff,
int packet_len, bool direct_link)
{
unsigned char *skb_buff;
unsigned long new_direct_link_flag;

skb_buff = skb_put_data(forw_packet_aggr->skb, packet_buff,
packet_len);
skb_put_data(forw_packet_aggr->skb, packet_buff, packet_len);
forw_packet_aggr->packet_len += packet_len;
forw_packet_aggr->num_packets++;

Expand Down
4 changes: 2 additions & 2 deletions net/batman-adv/bat_v_ogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static void batadv_v_ogm_send(struct work_struct *work)
struct batadv_priv *bat_priv;
struct batadv_ogm2_packet *ogm_packet;
struct sk_buff *skb, *skb_tmp;
unsigned char *ogm_buff, *pkt_buff;
unsigned char *ogm_buff;
int ogm_buff_len;
u16 tvlv_len = 0;
int ret;
Expand Down Expand Up @@ -166,7 +166,7 @@ static void batadv_v_ogm_send(struct work_struct *work)
goto reschedule;

skb_reserve(skb, ETH_HLEN);
pkt_buff = skb_put_data(skb, ogm_buff, ogm_buff_len);
skb_put_data(skb, ogm_buff, ogm_buff_len);

ogm_packet = (struct batadv_ogm2_packet *)skb->data;
ogm_packet->seqno = htonl(atomic_read(&bat_priv->bat_v.ogm_seqno));
Expand Down

0 comments on commit e04de48

Please sign in to comment.