Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1042261AbdDUSin (ORCPT ); Fri, 21 Apr 2017 14:38:43 -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 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1047 Lines: 31 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; -- 2.12.2