summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2017-11-14 15:52:08 +0300
committerJason Gunthorpe <jgg@mellanox.com>2017-12-19 01:37:09 +0300
commit86937fcd6ed28a2c253119998e0eebfb73dd289e (patch)
tree414004b90352e54e0ebd40762277463ffcf7ae1a /drivers
parent1c43d5d308f0858e763f46bc2bd01cd32b67c63e (diff)
downloadlinux-86937fcd6ed28a2c253119998e0eebfb73dd289e.tar.xz
RDMA/core: Avoid redundant memcpy in rdma_addr_find_l2_eth_by_grh
rdma_resolve_ip already copies 'addr' to its dev_addr argument. Remove the duplicate memcpy and since it was the only user, remove the 'addr' member from resolve_cb_context. Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/addr.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index da4469c38eac..6679dd43fe08 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -744,7 +744,6 @@ void rdma_addr_cancel(struct rdma_dev_addr *addr)
EXPORT_SYMBOL(rdma_addr_cancel);
struct resolve_cb_context {
- struct rdma_dev_addr *addr;
struct completion comp;
int status;
};
@@ -752,9 +751,6 @@ struct resolve_cb_context {
static void resolve_cb(int status, struct sockaddr *src_addr,
struct rdma_dev_addr *addr, void *context)
{
- if (!status)
- memcpy(((struct resolve_cb_context *)context)->addr,
- addr, sizeof(struct rdma_dev_addr));
((struct resolve_cb_context *)context)->status = status;
complete(&((struct resolve_cb_context *)context)->comp);
}
@@ -780,7 +776,6 @@ int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
dev_addr.bound_dev_if = ndev->ifindex;
dev_addr.net = &init_net;
- ctx.addr = &dev_addr;
init_completion(&ctx.comp);
ret = rdma_resolve_ip(&self, &sgid_addr._sockaddr, &dgid_addr._sockaddr,
&dev_addr, 1000, resolve_cb, &ctx);