浏览代码

batman-adv: fix coccinelle warnings

net/batman-adv/network-coding.c:1535:1-7: Replace memcpy with struct assignment

Generated by: coccinelle/misc/memcpy-assign.cocci
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Fengguang Wu 12 年之前
父节点
当前提交
abae9479ca
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/batman-adv/network-coding.c

+ 1 - 1
net/batman-adv/network-coding.c

@@ -1636,7 +1636,7 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,
 
 
 	/* Reconstruct original mac header */
 	/* Reconstruct original mac header */
 	ethhdr = eth_hdr(skb);
 	ethhdr = eth_hdr(skb);
-	memcpy(ethhdr, &ethhdr_tmp, sizeof(*ethhdr));
+	*ethhdr = ethhdr_tmp;
 
 
 	/* Select the correct unicast header information based on the location
 	/* Select the correct unicast header information based on the location
 	 * of our mac address in the coded_packet header
 	 * of our mac address in the coded_packet header