net: qlge: use memmove instead of skb_copy_to_linear_data
authorArnd Bergmann <arnd@arndb.de>
Fri, 2 Feb 2018 15:45:44 +0000 (16:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Feb 2018 00:44:34 +0000 (19:44 -0500)
commitcfabb1779d725c6d719793e44f5c50382eae6227
tree10890aff220ac537a2328eb311d072a369d1b221
parent11f711081af0eb54190dc0de96ba4a9cd494666b
net: qlge: use memmove instead of skb_copy_to_linear_data

gcc-8 points out that the skb_copy_to_linear_data() argument points to
the skb itself, which makes it run into a problem with overlapping
memcpy arguments:

In file included from include/linux/ip.h:20,
                 from drivers/net/ethernet/qlogic/qlge/qlge_main.c:26:
drivers/net/ethernet/qlogic/qlge/qlge_main.c: In function 'ql_realign_skb':
include/linux/skbuff.h:3378:2: error: 'memcpy' source argument is the same as destination [-Werror=restrict]
  memcpy(skb->data, from, len);

It's unclear to me what the best solution is, maybe it ought to use a
different helper that adjusts the skb data in a safe way. Simply using
memmove() here seems like the easiest workaround.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlge/qlge_main.c