[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141216085357.GB14666@box2.japko.eu>
Date: Tue, 16 Dec 2014 09:53:58 +0100
From: Krzysztof Adamski <k@...ko.eu>
To: Joe Perches <joe@...ches.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Malcolm Priestley <tvboxspy@...il.com>,
Forest Bond <forest@...ttletooquiet.net>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: vt6656: Use ether_addr_copy() in
vnt_fill_ieee80211_rts.
On Tue, Dec 16, 2014 at 12:42:06AM -0800, Joe Perches wrote:
>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.
Hi,
Thank you for your feedback. Yes, you are right. It was a bit of a
shortcut in my reasoning. Since struct is aligned and it's packed and
both members preceding the array we want to copy are 16 bit large, the
array address is guaranteed to be properly aligned.
Best regards,
Krzysztof Adamski
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists