Skip to content

Commit

Permalink
brcm80211: Remove bogus memcpy in ai_detach
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Andi Kleen authored and John W. Linville committed Sep 11, 2012
1 parent 959cd68 commit af2c8ff
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit af2c8ff

Please sign in to comment.