From patchwork Fri Apr 21 18:37:11 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: 9693447 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 4FD60601D4 for ; Fri, 21 Apr 2017 18:38:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4543D28654 for ; Fri, 21 Apr 2017 18:38:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39D5D28666; Fri, 21 Apr 2017 18:38:50 +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 A8E2828654 for ; Fri, 21 Apr 2017 18:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422853AbdDUSim (ORCPT ); Fri, 21 Apr 2017 14:38:42 -0400 Received: from mout.web.de ([212.227.15.14]:51359 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1042078AbdDUShm (ORCPT ); Fri, 21 Apr 2017 14:37:42 -0400 Received: from [192.168.1.2] ([77.182.39.184]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MKNl8-1d2Bvb0qc2-001fIi; Fri, 21 Apr 2017 20:37:13 +0200 Subject: [PATCH v2 07/17] IB/mlx4: Move an assignment out of a check in forward_trap() From: SF Markus Elfring To: Doug Ledford , Hal Rosenstock , Leon Romanovsky , Majd Dibbiny , Matan Barak , Sean Hefty , Yishai Hadas , linux-rdma@vger.kernel.org Cc: LKML , kernel-janitors@vger.kernel.org References: <1935365a-bd7c-461e-6a84-0c5d3a501fff@users.sourceforge.net> <1492720654.3041.16.camel@redhat.com> Message-ID: Date: Fri, 21 Apr 2017 20:37:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:0Cjl94WnyiuEOL1qxxSWazVZunN1TSGMQaoRwJO7V6Lg+PE5UsU 3nEQtK89O32L2iRm/YClI9KXI2RaKz7nCVcAbNzKMLe4tSU9pD9QhAQLOh4Ss1x7MX9/GTo E3M7Dp8l6Uqr2CXFALcQex7mEyM2eY4fNAOPtTIq79Dl9+zjB+EtKwUk02ZvQu0E3P8Gg/M JlqmjVsf/N6tv3IfNX5jA== X-UI-Out-Filterresults: notjunk:1; V01:K0:S8OMyV172P0=:M+3X7GuS5A0eRZFiM2Lmlw FQXBeC2uHnfSGQZI2IrlG44O4PdSUASB9wCWMNFrPVAhyScoUhiHqZXpPt2vywuUo6HGR5T7m hO+g21TeqWnfW1mjSDf1lCQuDPTOqs27ncAumaBQmFLaPP5MYVZ9pFnQ/L4dPJrUKlXPuDGMq RU4i3NtM9A7J8QUKHACZKWHmY6+dQ8/byVV2S33G9kaB7wI3gkpOLqGyJ7UIJdrb4NL/dCmOF 7hvcMZSgngyBFCRE1WI9PZayj+vWy1AsTon748Lk7f94S9YpJ+9fntfWV3caktvnN4HTArMLN fKuSYlfTgee4F72YL/B8o1h6GEGCSaipvYGPVN2bDoFF6rt+XdBbWK6dFNOHX7Fm5bgwBJb5V FJ9WOWykzXsIlmEiXRMjSvaxjzmoF7sxWFCge8yMjnP/0aUHY/25aolxQzDEzYJld+q2bsC4k WIx3K7464bvB/GmK03O2eRjwUJwor5897LJx+E6L26jnJLAoFTo8x/utKuaPO9KhAYNB2agFe fqdEFpoPsoW+YncVJINRsnQGBRjIIr50VJaTjXYv4ryz7OZuqPZK1BR5Rvy+FETslWpx5myW+ nye3zbLdHaq8D6VcLc//OsqWb4BXipuZamGHUKqfEZdc4bWytD/AvP8APAGLqZwTQROmeAlND nDNXFLx5tZXQZQ57kn53TqhORvrMRQBE0KU1rdoSfmpnLY8vx6asUHekBVffr2P4QigIYlabZ SD0BFN+ZRAwOJtHYiSeyCII995lwY+uicvvLo3gLc4p3taWGFH9M0s4OjRyGXRSkh3mU87WNe 28XX1dL 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, 21 Apr 2017 14:00:08 +0200 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 3caf468ca133..0a5b46791335 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;