From patchwork Mon Jul 30 18:56:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10549591 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEF4115E2 for ; Mon, 30 Jul 2018 18:57:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F9C92842A for ; Mon, 30 Jul 2018 18:57:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93D2A286EC; Mon, 30 Jul 2018 18:57:15 +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 46E5A2842A for ; Mon, 30 Jul 2018 18:57:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730513AbeG3Udf (ORCPT ); Mon, 30 Jul 2018 16:33:35 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38531 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730400AbeG3Udf (ORCPT ); Mon, 30 Jul 2018 16:33:35 -0400 Received: by mail-wm0-f68.google.com with SMTP id t25-v6so482520wmi.3 for ; Mon, 30 Jul 2018 11:57:13 -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:in-reply-to:references; bh=DyMuWzwI6oEtAuKlk3haUJYfYtfZGrA9vRpjJMb69yM=; b=D5kYbkZtEDFjte5G3LQzp/wbycEqsF/GfyJ2TDOULmBpz4r7qz2RidBq7i6Ub+zcnq WSYaokpTJXJfGstrsyN9k8coOiJ8EudQnzRyDmIKF+YGblLX4uIApzb9ddwVLxcNtd+Z P5ghJxfWb5aI6sNiHSBLpwHzpeLbFq1bTEUE7jOaUt0QBaTrW0UFSp/oX7OXcjpp55WY /STN5/GH7mTCaRhZje1irbejICqczNkBVvd1H3I4Ac+uY2UzOyLJRC4eqYeIqD7btGca MTrFHHYJWPA/75GbYuUUoj0bc42l3M1jQJg4OHxZ/7D3j+Xi3JwEs0XxyNFqbGT7aWeP 2NFA== 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:in-reply-to :references; bh=DyMuWzwI6oEtAuKlk3haUJYfYtfZGrA9vRpjJMb69yM=; b=kbiL/ezts86jnxC2b8CNK75WBraZqeTbp//RB8syvAC0uJGto4MZrxld6rnhrv4rpB H+gbDnh/JeHqzDSCYDWI6thzAViMZ5v8hMqvmQG0ZZNRLPckHiyR3/nM12WiRCQnOO7k 9KxbKjhhyoGmUIPEaEtbmdLedN8uyV9CvPJFScvJ1cExj8W9193dtXnYDrjx2e01O2PA AEjvbeqxjZMbAmxOk3yIsFxsrdEBB5BG1j6JD1PUFAPbQbOvqSzCqLqJCxzuq+WniquN HRhpNtbqdj3w3pWXkxFvUSll3hwzx6Lm7HWhe4fk55yod9E35rrcLLpbsDWVsKWtrJ2i PulQ== X-Gm-Message-State: AOUpUlFqXLgalwIMbUtnwsEqW9GTnkgWYNBcDvGIRhKPRCOWceJHTtLV pGInLBpa4uNPIiU+bWHIljo= X-Google-Smtp-Source: AAOMgpfZ+uotsXPLm5Zb0aiyNcjOW6XsjViLq09i4bt6TA5ky2RVxlyEotasuLkhuX9sQwHmvIxgQQ== X-Received: by 2002:a1c:e70b:: with SMTP id e11-v6mr313897wmh.22.1532977032799; Mon, 30 Jul 2018 11:57:12 -0700 (PDT) Received: from localhost.localdomain ([2.53.153.184]) by smtp.gmail.com with ESMTPSA id z14-v6sm343295wma.18.2018.07.30.11.57.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jul 2018 11:57:12 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, Kamal Heib Subject: [PATCH rdma-next 2/2] RDMA/ipoib: Fix check for return code from ib_create_srq Date: Mon, 30 Jul 2018 21:56:44 +0300 Message-Id: <20180730185644.14702-3-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180730185644.14702-1-kamalheib1@gmail.com> References: <20180730185644.14702-1-kamalheib1@gmail.com> 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 Make sure to check for "-EOPNOTSUPP" instead of "-ENOSYS" which is the return code from ib_create_srq() in case that it not supported. Signed-off-by: Kamal Heib --- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 8b44f33c7ae0..8ef50e46157c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -1560,7 +1560,7 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge) priv->cm.srq = ib_create_srq(priv->pd, &srq_init_attr); if (IS_ERR(priv->cm.srq)) { - if (PTR_ERR(priv->cm.srq) != -ENOSYS) + if (PTR_ERR(priv->cm.srq) != -EOPNOTSUPP) pr_warn("%s: failed to allocate SRQ, error %ld\n", priv->ca->name, PTR_ERR(priv->cm.srq)); priv->cm.srq = NULL;