From patchwork Thu May 18 18:11:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 9735071 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 F3BCD600CC for ; Thu, 18 May 2017 18:34:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C60F9288B4 for ; Thu, 18 May 2017 18:34:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B84D228900; Thu, 18 May 2017 18:34:09 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 47450288B4 for ; Thu, 18 May 2017 18:34:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754862AbdERSeI (ORCPT ); Thu, 18 May 2017 14:34:08 -0400 Received: from gateway31.websitewelcome.com ([192.185.143.39]:16183 "EHLO gateway31.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752898AbdERSeH (ORCPT ); Thu, 18 May 2017 14:34:07 -0400 X-Greylist: delayed 1316 seconds by postgrey-1.27 at vger.kernel.org; Thu, 18 May 2017 14:34:07 EDT Received: from cm4.websitewelcome.com (unknown [108.167.139.16]) by gateway31.websitewelcome.com (Postfix) with ESMTP id A3B476AB0A5 for ; Thu, 18 May 2017 13:11:19 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cm4.websitewelcome.com with id MuBJ1v00V0V9LXg01uBKTn; Thu, 18 May 2017 13:11:19 -0500 Received: from [189.152.179.187] (port=36412 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1dBPtO-000KoZ-AE; Thu, 18 May 2017 13:11:18 -0500 Date: Thu, 18 May 2017 13:11:17 -0500 From: "Gustavo A. R. Silva" To: Faisal Latif , Shiraz Saleem , Doug Ledford , Sean Hefty , Hal Rosenstock Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Yuval Shaia , "Gustavo A. R. Silva" Subject: [PATCH] infiniband: hw: i40iw: fix duplicated code for different branches Message-ID: <20170518181117.GA14287@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170518125413.Horde.xnD_6K5mFzkhQLdyz7R3LXt@gator4166.hostgator.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.152.179.187 X-Exim-ID: 1dBPtO-000KoZ-AE X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.179.187]:36412 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= 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 Refactor code to avoid identical code for different branches. Addresses-Coverity-ID: 1357356 Reviewed-by: Yuval Shaia Signed-off-by: Gustavo A. R. Silva Acked-by: Shiraz Saleem --- drivers/infiniband/hw/i40iw/i40iw_virtchnl.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c b/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c index f4d1368..48fd327 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c +++ b/drivers/infiniband/hw/i40iw/i40iw_virtchnl.c @@ -443,10 +443,7 @@ enum i40iw_status_code i40iw_vchnl_recv_pf(struct i40iw_sc_dev *dev, if (!dev->vchnl_up) return I40IW_ERR_NOT_READY; if (vchnl_msg->iw_op_code == I40IW_VCHNL_OP_GET_VER) { - if (vchnl_msg->iw_op_ver != I40IW_VCHNL_OP_GET_VER_V0) - vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg); - else - vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg); + vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg); return I40IW_SUCCESS; } for (iw_vf_idx = 0; iw_vf_idx < I40IW_MAX_PE_ENABLED_VF_COUNT; iw_vf_idx++) {