IPoIB: Remove unnecessary port query
authorAlex Estrin <alex.estrin@intel.com>
Wed, 20 Aug 2014 15:15:08 +0000 (11:15 -0400)
committerRoland Dreier <roland@purestorage.com>
Fri, 19 Sep 2014 17:17:40 +0000 (10:17 -0700)
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>
drivers/infiniband/ulp/ipoib/ipoib_multicast.c

index d4e005720d0181729096b4fb8a81aa21498f023b..ffb83b5f7e805e411f1506d66a53f8465b90c439 100644 (file)
@@ -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;