lkml.org 
[lkml]   [2014]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2014-12-16 10:21    [W:0.037 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site