[firefly] [PATCH] staging: gdm724x: replace memcpy with struct assignment

Teodora Baluta teobaluta at gmail.com
Wed Oct 23 23:51:55 EEST 2013


This patch fixes the following coccinelle issues:

drivers/staging/gdm724x/gdm_lte.c:153:1-7: Replace memcpy with struct assignment
drivers/staging/gdm724x/gdm_lte.c:302:2-8: Replace memcpy with struct assignment

Signed-off-by: Teodora Baluta <teobaluta at gmail.com>
---
 drivers/staging/gdm724x/gdm_lte.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c
index c57a6ba..c1f68d1 100644
--- a/drivers/staging/gdm724x/gdm_lte.c
+++ b/drivers/staging/gdm724x/gdm_lte.c
@@ -150,7 +150,7 @@ static int gdm_lte_emulate_arp(struct sk_buff *skb_in, u32 nic_type)
 	arp_data_out = (struct arpdata *)(arp_temp + sizeof(struct arphdr));
 
 	/* Copy the arp header */
-	memcpy(arp_out, arp_in, sizeof(struct arphdr));
+	*arp_out = *arp_in;
 	arp_out->ar_op = htons(ARPOP_REPLY);
 
 	/* Copy the arp payload: based on 2 bytes of mac and fill the IP */
@@ -299,7 +299,7 @@ static int gdm_lte_emulate_ndp(struct sk_buff *skb_in, u32 nic_type)
 		na.link_layer_address[4] = 0x63;
 		na.link_layer_address[5] = 0xc7;
 
-		memcpy(&ipv6_out, ipv6_in, sizeof(struct ipv6hdr));
+		ipv6_out = *ipv6_in;
 		memcpy(ipv6_out.saddr.in6_u.u6_addr8, &na.target_address, 16);
 		memcpy(ipv6_out.daddr.in6_u.u6_addr8, ipv6_in->saddr.in6_u.u6_addr8, 16);
 		ipv6_out.payload_len = htons(sizeof(struct icmp6hdr) + sizeof(struct neighbour_advertisement));
-- 
1.7.10.4



More information about the firefly mailing list