* [PATCH] Remove bogus memcpy in brcm80211 ai_detach
@ 2012-09-03 19:13 Andi Kleen
2012-09-03 19:22 ` Larry Finger
0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2012-09-03 19:13 UTC (permalink / raw)
To: brcm80211-dev-list, linux-wireless, linux-kernel
gcc 4.8 warns for this memcpy. While the copy size is correct, the whole
copy seems to be a nop because the destination is never used, and
there's no need to use memcpy to copy pointers anyways. And the
type of the pointer was wrong, but at least those are always the same.
Just remove it.
/backup/lsrc/git/linux-lto-2.6/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c: In function 'ai_detach':
/backup/lsrc/git/linux-lto-2.6/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c:539:32: warning: argument to 'sizeof' in 'memcpy' call is the same pointer type 'struct si_pub **' as the destination; expected 'struct si_pub *' or an explicit length [-Wsizeof-pointer-memaccess]
memcpy(&si_local, &sih, sizeof(struct si_pub **));
^
Signed-off-by: Andi Kleen <ak@linux.intel.com>
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
index 8c9345d..b89f127 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
@@ -535,9 +535,6 @@ void ai_detach(struct si_pub *sih)
{
struct si_info *sii;
- struct si_pub *si_local = NULL;
- memcpy(&si_local, &sih, sizeof(struct si_pub **));
-
sii = container_of(sih, struct si_info, pub);
if (sii == NULL)
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove bogus memcpy in brcm80211 ai_detach
2012-09-03 19:13 [PATCH] Remove bogus memcpy in brcm80211 ai_detach Andi Kleen
@ 2012-09-03 19:22 ` Larry Finger
2012-09-03 19:57 ` Andi Kleen
0 siblings, 1 reply; 4+ messages in thread
From: Larry Finger @ 2012-09-03 19:22 UTC (permalink / raw)
To: Andi Kleen; +Cc: brcm80211-dev-list, linux-wireless, linux-kernel
On 09/03/2012 02:13 PM, Andi Kleen wrote:
> gcc 4.8 warns for this memcpy. While the copy size is correct, the whole
> copy seems to be a nop because the destination is never used, and
> there's no need to use memcpy to copy pointers anyways. And the
> type of the pointer was wrong, but at least those are always the same.
>
> Just remove it.
Andi,
Have you compiled all of wireless with gcc 4.8? If so, can I assume that you
will report warnings for other drivers?
Thanks,
Larry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove bogus memcpy in brcm80211 ai_detach
2012-09-03 19:22 ` Larry Finger
@ 2012-09-03 19:57 ` Andi Kleen
2012-09-03 20:03 ` Larry Finger
0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2012-09-03 19:57 UTC (permalink / raw)
To: Larry Finger; +Cc: brcm80211-dev-list, linux-wireless, linux-kernel
On Mon, Sep 03, 2012 at 02:22:48PM -0500, Larry Finger wrote:
> On 09/03/2012 02:13 PM, Andi Kleen wrote:
> >gcc 4.8 warns for this memcpy. While the copy size is correct, the whole
> >copy seems to be a nop because the destination is never used, and
> >there's no need to use memcpy to copy pointers anyways. And the
> >type of the pointer was wrong, but at least those are always the same.
> >
> >Just remove it.
>
> Andi,
>
> Have you compiled all of wireless with gcc 4.8? If so, can I assume that
> you will report warnings for other drivers?
I did 64bit allyesconfig with LTO yes. wireless has very few warnings overall,
compared to many other subsystems.
I found one other issue in it for which I'm sending a patch.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove bogus memcpy in brcm80211 ai_detach
2012-09-03 19:57 ` Andi Kleen
@ 2012-09-03 20:03 ` Larry Finger
0 siblings, 0 replies; 4+ messages in thread
From: Larry Finger @ 2012-09-03 20:03 UTC (permalink / raw)
To: Andi Kleen; +Cc: brcm80211-dev-list, linux-wireless, linux-kernel
On 09/03/2012 02:57 PM, Andi Kleen wrote:
> On Mon, Sep 03, 2012 at 02:22:48PM -0500, Larry Finger wrote:
>> Have you compiled all of wireless with gcc 4.8? If so, can I assume that
>> you will report warnings for other drivers?
>
> I did 64bit allyesconfig with LTO yes. wireless has very few warnings overall,
> compared to many other subsystems.
>
> I found one other issue in it for which I'm sending a patch.
Thanks for responding, and for doing the cleanup.
Larry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-03 20:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-03 19:13 [PATCH] Remove bogus memcpy in brcm80211 ai_detach Andi Kleen
2012-09-03 19:22 ` Larry Finger
2012-09-03 19:57 ` Andi Kleen
2012-09-03 20:03 ` Larry Finger
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).