Commit 471e7058 authored by Honggang LI's avatar Honggang LI Committed by Doug Ledford

IB/core: change rdma_gid2ip into void function as it always return zero

Signed-off-by: default avatarHonggang Li <honli@redhat.com>
Acked-by: default avatarSean Hefty <sean.hefty@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent d4988623
...@@ -472,13 +472,8 @@ int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, union ib_gid *dgid, u8 *dmac, ...@@ -472,13 +472,8 @@ int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, union ib_gid *dgid, u8 *dmac,
} sgid_addr, dgid_addr; } sgid_addr, dgid_addr;
ret = rdma_gid2ip(&sgid_addr._sockaddr, sgid); rdma_gid2ip(&sgid_addr._sockaddr, sgid);
if (ret) rdma_gid2ip(&dgid_addr._sockaddr, dgid);
return ret;
ret = rdma_gid2ip(&dgid_addr._sockaddr, dgid);
if (ret)
return ret;
memset(&dev_addr, 0, sizeof(dev_addr)); memset(&dev_addr, 0, sizeof(dev_addr));
...@@ -512,10 +507,8 @@ int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id) ...@@ -512,10 +507,8 @@ int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id)
struct sockaddr_in6 _sockaddr_in6; struct sockaddr_in6 _sockaddr_in6;
} gid_addr; } gid_addr;
ret = rdma_gid2ip(&gid_addr._sockaddr, sgid); rdma_gid2ip(&gid_addr._sockaddr, sgid);
if (ret)
return ret;
memset(&dev_addr, 0, sizeof(dev_addr)); memset(&dev_addr, 0, sizeof(dev_addr));
ret = rdma_translate_ip(&gid_addr._sockaddr, &dev_addr, vlan_id); ret = rdma_translate_ip(&gid_addr._sockaddr, &dev_addr, vlan_id);
if (ret) if (ret)
......
...@@ -160,7 +160,7 @@ static inline int rdma_ip2gid(struct sockaddr *addr, union ib_gid *gid) ...@@ -160,7 +160,7 @@ static inline int rdma_ip2gid(struct sockaddr *addr, union ib_gid *gid)
} }
/* Important - sockaddr should be a union of sockaddr_in and sockaddr_in6 */ /* Important - sockaddr should be a union of sockaddr_in and sockaddr_in6 */
static inline int rdma_gid2ip(struct sockaddr *out, union ib_gid *gid) static inline void rdma_gid2ip(struct sockaddr *out, union ib_gid *gid)
{ {
if (ipv6_addr_v4mapped((struct in6_addr *)gid)) { if (ipv6_addr_v4mapped((struct in6_addr *)gid)) {
struct sockaddr_in *out_in = (struct sockaddr_in *)out; struct sockaddr_in *out_in = (struct sockaddr_in *)out;
...@@ -173,7 +173,6 @@ static inline int rdma_gid2ip(struct sockaddr *out, union ib_gid *gid) ...@@ -173,7 +173,6 @@ static inline int rdma_gid2ip(struct sockaddr *out, union ib_gid *gid)
out_in->sin6_family = AF_INET6; out_in->sin6_family = AF_INET6;
memcpy(&out_in->sin6_addr.s6_addr, gid->raw, 16); memcpy(&out_in->sin6_addr.s6_addr, gid->raw, 16);
} }
return 0;
} }
static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr, static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment