Re: [PATCH] staging: vt6656: Use ether_addr_copy() in vnt_fill_ieee80211_rts.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux