Subject: [PATCH 05/13] via-velocity: use memmove

From: Stephen Hemminger <[email-masked]>
Date: Wed, 16 Apr 2008 16:37:32 -0700

Use memmove to handle overlapping copy of data.
Compile tested only.

Signed-off-by: Stephen Hemminger <[email-masked]>

--- a/drivers/net/via-velocity.c	2008-04-16 16:21:25.000000000 -0700
+++ b/drivers/net/via-velocity.c	2008-04-16 16:24:48.000000000 -0700
@@ -1522,12 +1522,8 @@ static int velocity_rx_copy(struct sk_bu
 static inline void velocity_iph_realign(struct velocity_info *vptr,
 					struct sk_buff *skb, int pkt_size)
 {
-	/* FIXME - memmove ? */
 	if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) {
-		int i;
-
-		for (i = pkt_size; i >= 0; i--)
-			*(skb->data + i + 2) = *(skb->data + i);
+		memmove(skb->data + 2, skb->data, pkt_size);
 		skb_reserve(skb, 2);
 	}
 }

--