Skip to content

Commit

Permalink
IPoIB: Remove unnecessary port query
Browse files Browse the repository at this point in the history
There are two queries for port attributes one after another. A second
call is not needed since port_attr structure already holds the data.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Alex Estrin <alex.estrin@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Alex Estrin authored and Roland Dreier committed Sep 19, 2014
1 parent 52addcf commit 68f9d83
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/infiniband/ulp/ipoib/ipoib_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,21 +529,13 @@ void ipoib_mcast_join_task(struct work_struct *work)
port_attr.state);
return;
}
priv->local_lid = port_attr.lid;

if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid))
ipoib_warn(priv, "ib_query_gid() failed\n");
else
memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid));

{
struct ib_port_attr attr;

if (!ib_query_port(priv->ca, priv->port, &attr))
priv->local_lid = attr.lid;
else
ipoib_warn(priv, "ib_query_port failed\n");
}

if (!priv->broadcast) {
struct ipoib_mcast *broadcast;

Expand Down

0 comments on commit 68f9d83

Please sign in to comment.