From patchwork Mon Jul 9 19:21:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10515559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F6F6600CA for ; Mon, 9 Jul 2018 19:21:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D9902901F for ; Mon, 9 Jul 2018 19:21:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B4CF28FFF; Mon, 9 Jul 2018 19:21:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB08F28F3B for ; Mon, 9 Jul 2018 19:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754697AbeGITVX (ORCPT ); Mon, 9 Jul 2018 15:21:23 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35200 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754528AbeGITVV (ORCPT ); Mon, 9 Jul 2018 15:21:21 -0400 Received: by mail-wr1-f68.google.com with SMTP id a3-v6so2876951wrt.2 for ; Mon, 09 Jul 2018 12:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EV4gZExYhR6mwdlfWEMtCv3QLxlI+1Qa4674JPwn8zQ=; b=JLsJCfUZur+8sQKShaLl0pwOT6YPRiDtPhyHvZh8d0ZXXmfqEGEk2u6W5TIyOX4vlU K/+fmTIg1CzkWRfcFMNhGfV6eB1fyi4MaO2DuN1fAvkeMgJgo62KSMt5RhP11Q+PCZy1 0B3gn8YGK2IWiO/3CQvev5qxPF+XF4AAioUX4iDCgaorZgWjPQTIH9KhaFKKoOLRwFus TMWseal0UU1sZYZibkD0bC0qObglamqUf2/afqUOO7JUW/uyAsF1q4gWO/XhElIIYcq3 ZtBXzkGqAo66WTKabitkodOljeJ3OVfHX9IpcMBlGhptXoZtLLU+bHc9vjdfuue3ghFG 3ORA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EV4gZExYhR6mwdlfWEMtCv3QLxlI+1Qa4674JPwn8zQ=; b=XQMImvc155z4bP96aDOVObbqNY3TT4l5Jv5dyAZ93vD8SlE26gvocOzqVJ1HZw5231 LvbCqYslr2LtwXgSeWDAvLPsWUUTL7GHaezRrGoPOzTMivOt+orpaoSs8jZY6Vnesgj/ YWFq4oRu21/7eGJKF1mtch7Yq+/FylEfoPnpo1tOhXzeZh1VRLFOxM4I9VNBZZW1Ov2L olECrZ+c7F2sG5lrPtIi85KxC1BQje6Kphgh0VWmgLhO4wlUMqCO32GBtP7gLJqQr0fS 2CQHiBbYXZ9v4g3XTRyVwmz7ZBkk4UmK52ukk/mLb0z6vAjxrBi8W5U73+0g9WV/ufdc NIRg== X-Gm-Message-State: AOUpUlHnOgxViRle5nSHPWUukeCJUJH5+8rhZAQtP2j0q4TxLxspA0Wu 5FP5Amsp+Q81B+S81T5qf6I= X-Google-Smtp-Source: AAOMgpf+hWm+vBxuG5S5sZ5erUVSyfix3nTjstU6qPznhNbLHNeEkphUxMMwE1A9Mf7HwvInQM/0Bg== X-Received: by 2002:adf:ed8e:: with SMTP id c14-v6mr7860617wro.264.1531164080388; Mon, 09 Jul 2018 12:21:20 -0700 (PDT) Received: from localhost.localdomain (bzq-109-67-23-64.red.bezeqint.net. [109.67.23.64]) by smtp.gmail.com with ESMTPSA id l10-v6sm23367894wrv.23.2018.07.09.12.21.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 12:21:19 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe , Leon Romanovsky Cc: linux-rdma@vger.kernel.org, Kamal Heib Subject: [PATCH rdma-next v3] RDMA/ipoib: Fix return code from ipoib_cm_dev_init Date: Mon, 9 Jul 2018 22:21:03 +0300 Message-Id: <20180709192103.6936-1-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.4 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The proper return code is -EOPNOTSUPP and not -ENOSYS when the function isn't supported, also make sure to return the right error code from ipoib_transport_dev_init() when ipoib_cm_dev_init() is supported. Signed-off-by: Kamal Heib --- Changes from v2: - Make sure to return the right error code from ipoib_transport_dev_init() drivers/infiniband/ulp/ipoib/ipoib.h | 2 +- drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index a50b062ed13e..c7b7edc409e4 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h @@ -729,7 +729,7 @@ void ipoib_cm_dev_stop(struct net_device *dev) static inline int ipoib_cm_dev_init(struct net_device *dev) { - return -ENOSYS; + return -EOPNOTSUPP; } static inline diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c index ba4669f24014..8f929f094b2c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c @@ -168,8 +168,8 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca) else size += ipoib_recvq_size * ipoib_max_conn_qp; } else - if (ret != -ENOSYS) - return -ENODEV; + if (ret != -EOPNOTSUPP) + return ret; req_vec = (priv->port - 1) * 2;