From patchwork Wed Aug 20 15:15:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Estrin, Alex" X-Patchwork-Id: 4752311 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7E200C0338 for ; Wed, 20 Aug 2014 15:15:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B1BDC200F0 for ; Wed, 20 Aug 2014 15:15:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A91D0200EC for ; Wed, 20 Aug 2014 15:15:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751220AbaHTPPO (ORCPT ); Wed, 20 Aug 2014 11:15:14 -0400 Received: from mga11.intel.com ([192.55.52.93]:55486 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750942AbaHTPPN (ORCPT ); Wed, 20 Aug 2014 11:15:13 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 20 Aug 2014 08:15:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="374800903" Received: from sedona.ch.intel.com ([143.182.228.65]) by FMSMGA003.fm.intel.com with ESMTP; 20 Aug 2014 08:11:25 -0700 Received: from phlsvlogin03.ph.intel.com (phlsvlogin03.ph.intel.com [10.228.195.69]) by sedona.ch.intel.com (8.13.6/8.14.3/Standard MailSET/Hub) with ESMTP id s7KFF95J002716; Wed, 20 Aug 2014 08:15:10 -0700 Received: from phlsvlogin03.ph.intel.com (localhost [127.0.0.1]) by phlsvlogin03.ph.intel.com with ESMTP id s7KFF8CX014312; Wed, 20 Aug 2014 11:15:09 -0400 Subject: [PATCH 1/1] IB/ipoib: remove unnecessary port query To: Roland Dreier From: Alex Estrin Cc: linux-rdma@vger.kernel.org Date: Wed, 20 Aug 2014 11:15:08 -0400 Message-ID: <20140820151508.14287.53954.stgit@phlsvlogin03.ph.intel.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are two queries for port attributes going one after another. A second call is not needed since port_attr structure already holds the data. Reviewed-by: Ira Weiny Signed-off-by: Alex Estrin --- drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index d4e0057..ffb83b5 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c @@ -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;