public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: RDMA list <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH] mlx4: Fix unneeded return error in eth_link_query_port
Date: Sun, 24 Oct 2010 09:58:35 +0200	[thread overview]
Message-ID: <20101024075835.GA11359@mtldesk30> (raw)

eth_link_query_port() returns error if a netdevice was not yet associated with
the IBoE port. This is not required since we already initialize the link as
down.  On the other hand, we need other information that the query provides.
Specifically, this can cause a failure to initilize an IBoE device after this
commit 5eb620c8, which calls ib_query_port().
Fix this by always returning success.

Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/main.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 30cd111..bf3e20c 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -217,7 +217,6 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
 {
 	struct mlx4_ib_iboe *iboe = &to_mdev(ibdev)->iboe;
 	struct net_device *ndev;
-	int err = 0;
 	enum ib_mtu tmp;
 
 	props->active_width	= IB_WIDTH_4X;
@@ -237,10 +236,8 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
 	props->active_mtu	= IB_MTU_256;
 	spin_lock(&iboe->lock);
 	ndev = iboe->netdevs[port - 1];
-	if (!ndev) {
-		err = -ENOMEM;
+	if (!ndev)
 		goto out;
-	}
 
 	tmp = iboe_get_mtu(ndev->mtu);
 	props->active_mtu = tmp ? min(props->max_mtu, tmp) : IB_MTU_256;
@@ -251,7 +248,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
 
 out:
 	spin_unlock(&iboe->lock);
-	return err;
+	return 0;
 }
 
 static int mlx4_ib_query_port(struct ib_device *ibdev, u8 port,
-- 
1.7.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2010-10-24  7:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-24  7:58 Eli Cohen [this message]
2010-10-24 15:42 ` [PATCH] mlx4: Fix unneeded return error in eth_link_query_port Roland Dreier
     [not found]   ` <adahbgbppgx.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-24 16:00     ` Eli Cohen
2010-10-24 16:22       ` Roland Dreier
     [not found]         ` <adaocajo90s.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-24 18:05           ` Eli Cohen
     [not found]             ` <AANLkTimb++kFYFXCWajBGACpA1OpCXyyeyD-98Ed3uTu-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25  4:12               ` Roland Dreier
     [not found]                 ` <adad3qync5m.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-25  8:18                   ` Eli Cohen
2010-10-25  9:26               ` Or Gerlitz
     [not found]                 ` <4CC54D4E.7050203-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-25  9:33                   ` Or Gerlitz
     [not found]                     ` <4CC54ED7.6030303-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-25 11:37                       ` Eli Cohen
2010-10-25 10:47                   ` can't get IB link with the for-next branch / IBoE patches (was "mlx4: Fix unneeded return error...") Or Gerlitz
     [not found]                     ` <4CC5604D.2080803-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-25 13:36                       ` can't get IB link with the for-next branch / IBoE patches Roland Dreier
     [not found]                         ` <adaaam2jswk.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-25 16:17                           ` Eli Cohen
2010-10-25 16:45                             ` Or Gerlitz
2010-10-25 17:23                             ` Roland Dreier
     [not found]                               ` <adalj5mgp96.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-25 17:35                                 ` Roland Dreier
     [not found]                                   ` <adahbgagopw.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-26  9:33                                     ` Or Gerlitz
     [not found]                                       ` <4CC6A051.3010703-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-26 12:19                                         ` Or Gerlitz
     [not found]                                           ` <4CC6C75F.8030103-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-26 13:10                                             ` Or Gerlitz
2010-10-26 13:46                                             ` Eli Cohen
2010-10-25 10:47                   ` can't get IB link with the for-next branch / IBoE patches (was "mlx4: Fix unneeded return error...") Or Gerlitz
2010-10-25 11:34                   ` [PATCH] mlx4: Fix unneeded return error in eth_link_query_port Eli Cohen
2010-10-25 14:15                     ` Or Gerlitz
     [not found]                       ` <AANLkTi=ZxB4b463OOS6YGxTJSKxjyCj8vy0rNtj0n+uA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25 14:36                         ` Eli Cohen
2010-10-25 16:46                           ` Or Gerlitz
     [not found]                             ` <AANLkTimaEcFZMnYE+G3osTWzPkfxuBpRMtrrXF7xUPYv-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25 17:13                               ` Eli Cohen
2010-10-25 19:04                                 ` Or Gerlitz
     [not found]                                   ` <AANLkTik_4OzMLMWXud89m_rF47OQ3Wji9R_Bye+0DcTV-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25 19:15                                     ` Eli Cohen
     [not found]                                       ` <AANLkTi=yZUoexwVUCfbeGypEWC_8=oZaMu9mBTF+VJgq-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25 19:38                                         ` Or Gerlitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101024075835.GA11359@mtldesk30 \
    --to=eli-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox