staging: vt6656: fix Prefer ether_addr_copy() over memcpy() if the Ethernet addresses...
authorHeba Aamer <heba93aamer@gmail.com>
Wed, 21 Jan 2015 11:08:48 +0000 (13:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Jan 2015 11:59:17 +0000 (19:59 +0800)
commit48eaa7f59649eb4d371ad5e75c606f65e80a93ad
tree7ef7116563bcf8a58e8e6f803d65049f5e9f38e6
parent7a9331c0c0fcd57ae3966946188e1416fe415351
staging: vt6656: fix Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)

This patch fixes the following checkpatch.pl warning:
fix Prefer ether_addr_copy() over memcpy()
if the Ethernet addresses are __aligned(2)

Pahole showed that the 2 structs are aligned to u16

struct vnt_mic_hdr {
        u8                         id;                   /*     0     1 */
        u8                         tx_priority;          /*     1     1 */
        u8                         mic_addr2[6];         /*     2     6 */
        u8                         ccmp_pn[6];           /*     8     6 */
        __be16                     payload_len;          /*    14     2 */
        __be16                     hlen;                 /*    16     2 */
        __le16                     frame_control;        /*    18     2 */
        u8                         addr1[6];             /*    20     6 */
        u8                         addr2[6];             /*    26     6 */
        u8                         addr3[6];             /*    32     6 */
        __le16                     seq_ctrl;             /*    38     2 */
        u8                         addr4[6];             /*    40     6 */
        u16                        packing;              /*    46     2 */

        /* size: 48, cachelines: 1, members: 13 */
        /* last cacheline: 48 bytes */
};

struct ieee80211_hdr {
        __le16                     frame_control;        /*     0     2 */
        __le16                     duration_id;          /*     2     2 */
        u8                         addr1[6];             /*     4     6 */
        u8                         addr2[6];             /*    10     6 */
        u8                         addr3[6];             /*    16     6 */
        __le16                     seq_ctrl;             /*    22     2 */
        u8                         addr4[6];             /*    24     6 */

        /* size: 30, cachelines: 1, members: 7 */
        /* last cacheline: 30 bytes */
};

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Reviewed-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/rxtx.c