From: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Ping-Ke Shih <pkshih-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
Cc: Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Johannes Berg
<johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] rtlwifi: rtl8192cu: remove pointless memcpy
Date: Fri, 9 Feb 2018 10:56:57 -0600 [thread overview]
Message-ID: <22ae9af4-70db-19d7-9b6d-2b0e3dc853d0@lwfinger.net> (raw)
In-Reply-To: <20180209132531.2755482-1-arnd-r2nGTMty4D4@public.gmane.org>
On 02/09/2018 07:24 AM, Arnd Bergmann wrote:
> gcc-8 points out that source and destination of the memcpy() are
> always the same pointer, so the effect of memcpy() is undefined
> here (its arguments must not overlap):
>
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c: In function '_rtl_rx_process':
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c:430:2: error: 'memcpy' source argument is the same as destination [-Werror=restrict]
>
> Most likely this is harmless, but it's easy to just remove the
> line and get rid of the warning.
>
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
> ---
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
> index ac4a82de40c7..9ab56827124e 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
> @@ -427,7 +427,6 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb)
> (u32)hdr->addr1[0], (u32)hdr->addr1[1],
> (u32)hdr->addr1[2], (u32)hdr->addr1[3],
> (u32)hdr->addr1[4], (u32)hdr->addr1[5]);
> - memcpy(IEEE80211_SKB_RXCB(skb), rx_status, sizeof(*rx_status));
> ieee80211_rx(hw, skb);
> }
Argh. Once again I got tripped up on pointers. Yes, this patch is correct.
Acked-by: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
Sorry about the noise.
Larry
next prev parent reply other threads:[~2018-02-09 16:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 13:24 [PATCH] rtlwifi: rtl8192cu: remove pointless memcpy Arnd Bergmann
2018-02-09 16:16 ` Joe Perches
2018-02-09 16:44 ` Larry Finger
[not found] ` <20180209132531.2755482-1-arnd-r2nGTMty4D4@public.gmane.org>
2018-02-09 16:56 ` Larry Finger [this message]
2018-02-27 16:18 ` Kalle Valo
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=22ae9af4-70db-19d7-9b6d-2b0e3dc853d0@lwfinger.net \
--to=larry.finger-tq5ms3gmjblk1umjsbkqmq@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pkshih-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.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;
as well as URLs for NNTP newsgroup(s).