From patchwork Sat Feb 18 20:57:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9581245 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 BF346604A4 for ; Sat, 18 Feb 2017 20:57:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF2AC28739 for ; Sat, 18 Feb 2017 20:57:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A31E628768; Sat, 18 Feb 2017 20:57:53 +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 30B5028739 for ; Sat, 18 Feb 2017 20:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753343AbdBRU5v (ORCPT ); Sat, 18 Feb 2017 15:57:51 -0500 Received: from mout.web.de ([212.227.15.4]:62659 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753315AbdBRU5u (ORCPT ); Sat, 18 Feb 2017 15:57:50 -0500 Received: from [192.168.1.2] ([77.181.107.93]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LZvrx-1bwCf21lb3-00lpfU; Sat, 18 Feb 2017 21:57:17 +0100 Subject: [PATCH 09/29] IB/mlx4: Move an assignment out of a check in forward_trap() To: linux-rdma@vger.kernel.org, Doug Ledford , Hal Rosenstock , Leon Romanovsky , Matan Barak , Sean Hefty , Yishai Hadas References: <1935365a-bd7c-461e-6a84-0c5d3a501fff@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Sat, 18 Feb 2017 21:57:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1935365a-bd7c-461e-6a84-0c5d3a501fff@users.sourceforge.net> X-Provags-ID: V03:K0:jIbmM5KMC1y3ZFxucZH10S3lb8i0ULzMCqKyBBxhZoRAsFEGHnr 4x8MNtj0YRFIbL2NXcOXF6UjqFNbkfSf0HouFT88wPAeY5lk7kdTWR9DqHLQed8pEDq/YW7 PKyu6VM/E8aUq0puQVyVNsk3m/YhHx5dhtbDMch7qvU5CUQ0bPnvi5ROUm0/JcKabiInVVR Hzh2n6oBYxnb1kHpAAa/w== X-UI-Out-Filterresults: notjunk:1; V01:K0:9xr4CijQWac=:xfNGOUVl1fxFyXpFpfFNKc g6IM5ZhCfI6EZ/ZnqNtRm4XaMaWY5Imtti2TFTVUoJxth8F91Tnbiiz7napT3WW2pkTcHE8BU 3I6GV/ieBeD64dME1Rv/BLvpxjMUStMGk1Fp/NYN/N4O8l/SZexSF/DXwRzQVLEkma+BzCss1 d0BpeBucpEHwBd5SqJoIgw6MAEfEimctg1mvwaEv0fC1Jer2Y11mvCAWqm5mdrOjJCFdSAD1N Nqz+OtnX+PZrWEheOGWJDkpTe7fDmeNmf5OCBI9Yf1dPWdMBxxdtlRb4NAASlI6lHlE9zz2fB to/oAfR8Po8eDCSEr5lo/HwrtK7vbrUTdi9H4Poazi2OLW8oQ+/M6dvDGjgwzYOFWln1EYSg8 2m+bwK2RB84WytEphRWcYYnTHOOkCY/HzzhtGpXeB8wz/xm4wMfOmzPWzRLUc4pasvAf35V10 FXuru0gIw6j8LBmzOGbnzW0iOMyqmla17DexEoysekIoaNEkOHtEsAa0shLXabMkHPbfdf8DC /IcUBt2c4UEUyvn/6yVEpMbRZWTvfm/NDRGEQ73V36CHHBjgnYUFsNyP+4kJM9JxK8SeiOXHQ O8qf9n8DE9bvLAOhCbUhVnhGe8DFK/vmVhZNAtrsP2Rj00gQ2J00eOnIVD2yNRSHA4QkRjFUn +zIE8xM+w7iehmbAahX27j6tSpmpyYjTzxAQX+7somFaj3bXkSdx3fA9BsguQNIswoTASY5Sl mPNd4Y2W5LPNMGd2Lz/kp37SjwrM3zg/u1KZeb+15gvXAVMhhBbh7MZ1e+etanFaRpSRTsMcJ M0jTI25 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: Markus Elfring Date: Fri, 17 Feb 2017 22:22:53 +0100 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix the affected source code place. Signed-off-by: Markus Elfring Reviewed-by: Majd Dibbiny --- drivers/infiniband/hw/mlx4/mad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index 9518b7244269..860fec8b9601 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c @@ -401,7 +401,8 @@ static void forward_trap(struct mlx4_ib_dev *dev, u8 port_num, const struct ib_m */ spin_lock_irqsave(&dev->sm_lock, flags); memcpy(send_buf->mad, mad, sizeof *mad); - if ((send_buf->ah = dev->sm_ah[port_num - 1])) + send_buf->ah = dev->sm_ah[port_num - 1]; + if (send_buf->ah) ret = ib_post_send_mad(send_buf, NULL); else ret = -EINVAL;