All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Krzysztof Adamski <k@japko.eu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Malcolm Priestley <tvboxspy@gmail.com>,
	Forest Bond <forest@alittletooquiet.net>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: vt6656: Use ether_addr_copy() in vnt_fill_ieee80211_rts.
Date: Tue, 16 Dec 2014 00:42:06 -0800	[thread overview]
Message-ID: <1418719326.2674.32.camel@perches.com> (raw)
In-Reply-To: <20141216083021.GA14666@box2.japko.eu>

On Tue, 2014-12-16 at 09:30 +0100, Krzysztof Adamski wrote:
> Both struct ieee80211_rts and struct ieee80211_hdr defined in
> linux/ieee80211.h are declared as __aligned(2) so it is safe to use
> ether_addr_copy() instead of memcpy().

Just fyi:

That the structure is declared __aligned(2) is not
the important bit.  What's necessary is that the
members in the struct are __aligned(2).

In this case, all of these members are.

> diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
[]
> @@ -392,8 +393,8 @@ static int vnt_fill_ieee80211_rts(struct vnt_usb_send_context *tx_context,
>   	rts->frame_control =
>   		cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
>   
> -	memcpy(rts->ra, hdr->addr1, ETH_ALEN);
> -	memcpy(rts->ta, hdr->addr2, ETH_ALEN);
> +	ether_addr_copy(rts->ra, hdr->addr1);
> +	ether_addr_copy(rts->ta, hdr->addr2);




  reply	other threads:[~2014-12-16  8:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16  8:30 [PATCH] staging: vt6656: Use ether_addr_copy() in vnt_fill_ieee80211_rts Krzysztof Adamski
2014-12-16  8:42 ` Joe Perches [this message]
2014-12-16  8:53   ` Krzysztof Adamski
2015-01-13  3:37 ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2014-12-08 11:13 Krzysztof Adamski

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=1418719326.2674.32.camel@perches.com \
    --to=joe@perches.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=k@japko.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tvboxspy@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.