From patchwork Sun Oct 24 07:58:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 265282 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9O7wQ4w023610 for ; Sun, 24 Oct 2010 07:58:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932154Ab0JXH6R (ORCPT ); Sun, 24 Oct 2010 03:58:17 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:42564 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932122Ab0JXH6R (ORCPT ); Sun, 24 Oct 2010 03:58:17 -0400 Received: by bwz11 with SMTP id 11so1595976bwz.19 for ; Sun, 24 Oct 2010 00:58:15 -0700 (PDT) Received: by 10.204.133.91 with SMTP id e27mr542456bkt.197.1287907094871; Sun, 24 Oct 2010 00:58:14 -0700 (PDT) Received: from localhost ([82.166.227.17]) by mx.google.com with ESMTPS id g8sm3673616bkg.11.2010.10.24.00.58.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 24 Oct 2010 00:58:14 -0700 (PDT) Date: Sun, 24 Oct 2010 09:58:35 +0200 From: Eli Cohen To: Roland Dreier Cc: RDMA list Subject: [PATCH] mlx4: Fix unneeded return error in eth_link_query_port Message-ID: <20101024075835.GA11359@mtldesk30> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 24 Oct 2010 07:58:27 +0000 (UTC) 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,