Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753313AbdHXPmL (ORCPT ); Thu, 24 Aug 2017 11:42:11 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34636 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752984AbdHXPmI (ORCPT ); Thu, 24 Aug 2017 11:42:08 -0400 From: Himanshu Jha To: dledford@redhat.com Cc: sean.hefty@intel.com, hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] IB/core: replace memcpy with ether_addr_copy Date: Thu, 24 Aug 2017 21:11:47 +0530 Message-Id: <1503589307-10457-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1007 Lines: 32 Use ether_addr_copy to copy an ethernet address of size ETH_ALEN instead of memcpy. Signed-off-by: Himanshu Jha --- drivers/infiniband/core/addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 437522c..fc5bf11 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -798,7 +798,7 @@ int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid, if (ret) return ret; - memcpy(dmac, dev_addr.dst_dev_addr, ETH_ALEN); + ether_addr_copy(dmac, dev_addr.dst_dev_addr); dev = dev_get_by_index(&init_net, dev_addr.bound_dev_if); if (!dev) return -ENODEV; @@ -831,7 +831,7 @@ int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id) if (ret) return ret; - memcpy(smac, dev_addr.src_dev_addr, ETH_ALEN); + ether_addr_copy(smac, dev_addr.src_dev_addr); return ret; } EXPORT_SYMBOL(rdma_addr_find_smac_by_sgid); -- 2.7.4