diff options
author | Aleksey Makarov <aleksey.makarov@caviumnetworks.com> | 2015-06-02 21:00:21 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-02 22:49:29 +0300 |
commit | e610cb32b4205c921e26fc8c7e43af7ae3543148 (patch) | |
tree | 08ef7c3debfe4aace52b3eab633bb0084068c30a /drivers/net/ethernet/cavium/thunder/nicvf_main.c | |
parent | 2cd2a196af20784b9f0a464d0f336de01a074a8c (diff) | |
download | linux-e610cb32b4205c921e26fc8c7e43af7ae3543148.tar.xz |
net: thunderx: rework mac address handling
This fixes sparse message:
drivers/net/ethernet/cavium/thunder/nicvf_main.c:385:40: sparse: cast to
restricted __le64
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Aleksey Makarov <aleksey.makarov@caviumnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/thunder/nicvf_main.c')
-rw-r--r-- | drivers/net/ethernet/cavium/thunder/nicvf_main.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index 989f005be9fd..54bba86c9534 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -197,8 +197,7 @@ static void nicvf_handle_mbx_intr(struct nicvf *nic) nic->vf_id = mbx.nic_cfg.vf_id & 0x7F; nic->tns_mode = mbx.nic_cfg.tns_mode & 0x7F; nic->node = mbx.nic_cfg.node_id; - ether_addr_copy(nic->netdev->dev_addr, - (u8 *)&mbx.nic_cfg.mac_addr); + ether_addr_copy(nic->netdev->dev_addr, mbx.nic_cfg.mac_addr); nic->link_up = false; nic->duplex = 0; nic->speed = 0; @@ -248,13 +247,10 @@ static void nicvf_handle_mbx_intr(struct nicvf *nic) static int nicvf_hw_set_mac_addr(struct nicvf *nic, struct net_device *netdev) { union nic_mbx mbx = {}; - int i; mbx.mac.msg = NIC_MBOX_MSG_SET_MAC; mbx.mac.vf_id = nic->vf_id; - for (i = 0; i < ETH_ALEN; i++) - mbx.mac.addr = (mbx.mac.addr << 8) | - netdev->dev_addr[i]; + ether_addr_copy(mbx.mac.mac_addr, netdev->dev_addr); return nicvf_send_msg_to_pf(nic, &mbx); } |