From patchwork Sun Dec 27 12:41:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7923371 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 60999BEEE5 for ; Sun, 27 Dec 2015 12:42:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83E6F20274 for ; Sun, 27 Dec 2015 12:42:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CA9E20272 for ; Sun, 27 Dec 2015 12:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752241AbbL0Ml7 (ORCPT ); Sun, 27 Dec 2015 07:41:59 -0500 Received: from mout.web.de ([212.227.15.14]:60736 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751948AbbL0Ml6 (ORCPT ); Sun, 27 Dec 2015 07:41:58 -0500 Received: from [192.168.1.2] ([77.182.171.219]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0LilYb-1aidyS0iWT-00cvET; Sun, 27 Dec 2015 13:41:49 +0100 Subject: [PATCH 2/2] InfiniBand-iSER-target: One jump label less in isert_reg_sig_mr() To: linux-rdma@vger.kernel.org, target-devel@vger.kernel.org, Doug Ledford , Hal Rosenstock , Or Gerlitz , Roi Dayan , Sagi Grimberg , Sean Hefty References: <566ABCD9.1060404@users.sourceforge.net> <567FDB4E.2040000@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <567FDC8A.6000602@users.sourceforge.net> Date: Sun, 27 Dec 2015 13:41:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <567FDB4E.2040000@users.sourceforge.net> X-Provags-ID: V03:K0:jhBvSbxAdI89Yw++oNJo0/5nuR7eWAZyzZghF9M3m3rDPO7+YcE w6CBIlXgY9hdHoRZ4dbgGi8iUkXCTE6rTzV7t1q469Vfi2ZhjNj3XTKUIoTP+7miheEMulg 7PyY2C6soWVNMSD5s2Zg9g94lBZ1dzSRS2G+ZP7Vgns9308nvVYBcMizxU+6w2kmL0cEzzV x1EcWD3pdD5Ll6QCydftQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:WIk/EOtOv5A=:4zZ40KA46CBLx86lGTPk1B JWwVSc3i6ozXK7P1IQLP862SfrJTVJaw0jKGexn3phcacIy1JgZWYd8xra5AOctthqRR6/jo/ 3/POBv1HQGQ7TNEJbrity+ePIGyqcut5k7WPqvkovLDEvLkJQtUnNYdb6EZLdEUBOWnoBCE3e a9BEPketiGEXL3GKQRKbe0ebNNF07IBUQvuWAvF6kKd2y0mHxwdYbiOsSgmQb+VRNIezVkjPD FY7p5/M5XE5IrhswlcFvH6qTPqvik/3Auus44WWkhGfDdqT3qJouzCJMyi9aNEmn4yUEqq4tX PCYs347JyvOujEYlWOkD5+G0ysp07VvadVP1mQHnopjK6GWm8QTONd7xjSqRYuyQdSN14m/hQ MobFQ+lSM9tDGHg87xUVJMnG/Gzxhn2Sh10UNy8dujhdte9UgWSduAnP+/+oKEK5A5/lCgJuE VKKz7ixzD6WC2vYMjmtsZ1M5XaGLucwg1O/762F8t2PNzrgBiGFIv2KsQPQ5TjDRxkTw7zJEI Q53LqZnRX7/OD1fxbYQOdDCRzbKw8MHz3Bwr3cA3YRyz6nHJK06t/tWa4nLZyiEMUodxyo8n4 qed4UMknp5YtuQCMx27Vixn1WeC7qUW3ErEJvna3lDA2NBASxD4phBz2QmNs1I5lDp35P3ZZW 4upc8Avp4epKEZarf9zG26bv1EXanHUkd5nvtQIK7wRgdYV2tBIxBXihPHunp7cFyPPRSRoks 2Ep5HemR5ZeN7btDefgy/pEYP7Myw040lWrzntKhZayCE3QUOZmyz94g7R0rYOu0C62pEut4v /h9K2vc Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 27 Dec 2015 12:54:52 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the function "isert_set_sig_attrs" or "ib_post_send" failed. 2. Delete the jump label "err" then. 3. Return zero as a constant at the end. Signed-off-by: Markus Elfring --- drivers/infiniband/ulp/isert/ib_isert.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 8a51c3b..9b22db0 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -2660,7 +2660,7 @@ isert_reg_sig_mr(struct isert_conn *isert_conn, memset(&sig_attrs, 0, sizeof(sig_attrs)); ret = isert_set_sig_attrs(se_cmd, &sig_attrs); if (ret) - goto err; + return ret; sig_attrs.check_mask = isert_set_prot_checks(se_cmd->prot_checks); @@ -2688,7 +2688,7 @@ isert_reg_sig_mr(struct isert_conn *isert_conn, ret = ib_post_send(isert_conn->qp, wr, &bad_wr); if (ret) { isert_err("fast registration failed, ret:%d\n", ret); - goto err; + return ret; } fr_desc->ind &= ~ISERT_SIG_KEY_VALID; @@ -2706,8 +2706,7 @@ isert_reg_sig_mr(struct isert_conn *isert_conn, isert_dbg("sig_sge: addr: 0x%llx length: %u lkey: %x\n", rdma_wr->ib_sg[SIG].addr, rdma_wr->ib_sg[SIG].length, rdma_wr->ib_sg[SIG].lkey); -err: - return ret; + return 0; } static int