From: Parav Pandit Date: Tue, 14 Nov 2017 12:52:11 +0000 (+0200) Subject: RDMA/core: Avoid copying ifindex twice X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=5092d17a39a454d8b045a8cdce514bf4b07d22dc;p=openwrt%2Fstaging%2Fblogic.git RDMA/core: Avoid copying ifindex twice rdma_copy_addr copies the ifndex to bound_dev_if. Therefore avoid copying it again after rdma_copy_addr call is completed. Signed-off-by: Parav Pandit Reviewed-by: Moni Shoua Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 0ae18608761c..a5b4cf030c11 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -265,7 +265,6 @@ int rdma_translate_ip(const struct sockaddr *addr, return -EADDRNOTAVAIL; rdma_copy_addr(dev_addr, dev, NULL); - dev_addr->bound_dev_if = dev->ifindex; dev_put(dev); break; #if IS_ENABLED(CONFIG_IPV6) @@ -276,7 +275,6 @@ int rdma_translate_ip(const struct sockaddr *addr, &((const struct sockaddr_in6 *)addr)->sin6_addr, dev, 1)) { rdma_copy_addr(dev_addr, dev, NULL); - dev_addr->bound_dev_if = dev->ifindex; break; } }