From patchwork Tue Dec 5 23:17:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10094103 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 4E311605B4 for ; Tue, 5 Dec 2017 23:17:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 411A428334 for ; Tue, 5 Dec 2017 23:17:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35AC9287FE; Tue, 5 Dec 2017 23:17:45 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 E236C283FF for ; Tue, 5 Dec 2017 23:17:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752768AbdLEXRn (ORCPT ); Tue, 5 Dec 2017 18:17:43 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36209 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752934AbdLEXRi (ORCPT ); Tue, 5 Dec 2017 18:17:38 -0500 Received: by mail-wr0-f194.google.com with SMTP id v105so2039026wrc.3 for ; Tue, 05 Dec 2017 15:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wS+0I+JTcYwrCSaAJCkHHjX23tkPa9oXtThxbbV3bnM=; b=iVooGUOy8Lx+Tzxp/vyNmsm61gXnLCBwpkv3H6HugcaozCrJAjV4GP9vsPRN/Bugaz xR/k00Ge2OOR7uBcOCsA/U+wXrwfe1W9XF1GAH+sTslsKKk5JJxgsnKIMIyQ/QCaKN7x EiKFDLRcsh+KE/4vUiwWM0W/xyAYGNC0G18cWQzqK0pbJ+fLU2eZxwM+4sz9XSCPLXYP NAjGQlJB6a3bERYf8Mnrm5doOZddP6J+s2Z09Q0HEENw56BeiBXiSy0WWGI+oQ/YyMQ9 DmKPIJauMaYcvyQOgf5LBwbaENTnkv8ocSBYDWTYlfCtuLjvKtHNdvD1pSl60KDmsPFm cY4g== 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=wS+0I+JTcYwrCSaAJCkHHjX23tkPa9oXtThxbbV3bnM=; b=Jd8Pbqw7+hxHKFxbD0VCDTQN2Ok7el8WN88WI9jat9vHKcLeNTWWdaBgPBKnhjfZLv GVAYP/GqjHYXdHWfDUX40pRSo/K7HiAsKvo0XubpJgDydD80t44cp8qYRjIhCnPtCV4A mANlCPtILYy68JlfEtYvD352ERwiY/8hvk0Z94XkGKApGTZ8pDC/5rl1AYjyM0GKuAQ4 ekZirKJOIJE84zK7oRdM4bc6254gKwTbSE76lEvrZJl52MGGx34hoeCQpJWn1ihQKPLr STwBdBtE1uENyXdjLJJvInhKQ9f9E9/7olwOmjCyTNFygXR2nRVLP/4SZ9zsNm89SCFj FOUQ== X-Gm-Message-State: AJaThX72s3r9vhPMFzdeSEdvIoIQOKMvEjRb3dzKoIAm3FuwhH1uq9Xx RyPs48WhRCvt5a3adMqeld2qgkLfxwo= X-Google-Smtp-Source: AGs4zMY6T2hRk4b57CZZggx1lUHfmpAa3OkGg0cnBB4am3QmvLDR0+cl9/E/oUPSiADp+b1rzjcoKw== X-Received: by 10.223.176.27 with SMTP id f27mr18347199wra.105.1512515857285; Tue, 05 Dec 2017 15:17:37 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [70.74.179.152]) by smtp.gmail.com with ESMTPSA id l140sm1848513wma.5.2017.12.05.15.17.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 15:17:34 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eMMSy-00054G-7N; Tue, 05 Dec 2017 16:17:32 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH 2/8] verbs: Remove duplicate NULL test from flow ops Date: Tue, 5 Dec 2017 16:17:15 -0700 Message-Id: <20171205231721.19410-3-jgg@ziepe.ca> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171205231721.19410-1-jgg@ziepe.ca> References: <20171205231721.19410-1-jgg@ziepe.ca> 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 From: Jason Gunthorpe The verbs_get_ctx_op macro already checks if the op is NULL. Signed-off-by: Jason Gunthorpe --- libibverbs/verbs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index b39dc30a6d2a6e..b9db76bc628707 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -1832,7 +1832,7 @@ static inline struct ibv_flow *ibv_create_flow(struct ibv_qp *qp, { struct verbs_context *vctx = verbs_get_ctx_op(qp->context, ibv_create_flow); - if (!vctx || !vctx->ibv_create_flow) { + if (!vctx) { errno = ENOSYS; return NULL; } @@ -1844,7 +1844,7 @@ static inline int ibv_destroy_flow(struct ibv_flow *flow_id) { struct verbs_context *vctx = verbs_get_ctx_op(flow_id->context, ibv_destroy_flow); - if (!vctx || !vctx->ibv_destroy_flow) + if (!vctx) return -ENOSYS; return vctx->ibv_destroy_flow(flow_id); }