mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: arnd@arndb.de
Cc: harish.patil@cavium.com, manish.chopra@cavium.com,
	Dept-GELinuxNICDev@cavium.com, keescook@chromium.org,
	johannes.berg@intel.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: qlge: use memmove instead of skb_copy_to_linear_data
Date: Fri, 02 Feb 2018 19:46:07 -0500 (EST)	[thread overview]
Message-ID: <20180202.194607.1678689429966846181.davem@davemloft.net> (raw)
In-Reply-To: <20180202154603.1617656-1-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Fri,  2 Feb 2018 16:45:44 +0100

> 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>

This looks fine, applied, thanks.

      reply	other threads:[~2018-02-03  0:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 15:45 Arnd Bergmann
2018-02-03  0:46 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180202.194607.1678689429966846181.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Dept-GELinuxNICDev@cavium.com \
    --cc=arnd@arndb.de \
    --cc=harish.patil@cavium.com \
    --cc=johannes.berg@intel.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manish.chopra@cavium.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®