From patchwork Sun Jan 22 08:33:08 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: 9530837 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 A4D3D6020B for ; Sun, 22 Jan 2017 08:33:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9751D27DA4 for ; Sun, 22 Jan 2017 08:33:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B1F028306; Sun, 22 Jan 2017 08:33:16 +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 AFB3327DA4 for ; Sun, 22 Jan 2017 08:33:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751190AbdAVIdN (ORCPT ); Sun, 22 Jan 2017 03:33:13 -0500 Received: from mout.web.de ([212.227.15.14]:52760 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdAVIdM (ORCPT ); Sun, 22 Jan 2017 03:33:12 -0500 Received: from [192.168.1.2] ([78.48.136.24]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MLP9u-1cVlY70e5i-000eM9; Sun, 22 Jan 2017 09:33:09 +0100 Subject: [PATCH 3/5] blk-throttle: Adjust two function calls together with a variable assignment To: linux-block@vger.kernel.org, Jens Axboe References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <7d68f93d-c14c-60aa-2b02-5005a0a62cad@users.sourceforge.net> Date: Sun, 22 Jan 2017 09:33:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:xIJ0WK144D67aGVMiFOPuHg7Tm2oGBdRR4rK/mOu2MvPnSDQIw4 /hE6+OyOWTGhIEycutS2RA1jn7vb8H12Ratb41yVt73QbwQ8fl/FdXGyT2Vl9JFrwbsutZw ZCD/hj1R4aPHXdzxsNKuQa1FRPMz21irQXk0Dia5XQmALdMhIohOwzAt/6Ww0vLLyFP415u X8ljBCH6kAoFjfiGfg7tg== X-UI-Out-Filterresults: notjunk:1; V01:K0:XKT4oQKwxUA=:Hr2ivATYHMiIKttE0BP9Jy 5SfQuyaZPB+uE75QImeBInYPPEB5B8EOvtJY6JddmBjcHdC9LCdZAu1ZamB2uz1zF/bbeVmcZ wq9RQfdhofOTyuJWsSMaRECZ9aysbcvvfApV9kkaO5rgIL31ci0eMri5JDHI1UF0UWVSlJMRW V35w8NkHrx57cURIPWwRCgzfWxUvBSc6TpGBErKSLCOiZ/LFTq3TMf2jfA4/boGfbjeQPsiK9 q3ZRlRztGcZ5o8btM1wA9zHlRTr8ClXcgSr/a436s6bxVSome+pHXgId7U7gY1qI4kdSROX+1 8DnJSql0sM4FaVN6DwjrjgMWkf5fnmOEAhRfOA1xIpzTawrbFL7pugyup2fqX0ohmMSoGqNlV DT8Go7O3LrZbtsiKWLuAoT50VeP5zS74/xoNDWpc2fOrJDwQjke0WtSsKs8QIGZoFQirFbUc7 /Gq/lphZXIICOw27BxBuWgZjV0FU3GxqnIY84m+2LrhLan7ma1B25MV+9TqU5CHPkgWrpLate 1xGT9H7KF9h7GxtXGPwR6hEBjAUCXUIa4W9w8VBbY6pgIXYpiFvk+WvNRJ/tEEX2KddQf+SX/ 7QADtsBW5zDJfDoscmrONfEXEUygjSxcZ0gYW+2PqbMxkirzCVVt3V6iMS0akqolHTKZF0rto bv6yFqHJlKeOVDynexvvgzDjBisbHopcUJnLU7CZSX1urWA8LkB+cpZkbmUV3yG7xRVVbAAAw VHT0BOgi13d/72V1LNTzd4eFL5RLgZnD3jyz9evdxwpay6WZ8Ob4Kfc9vAStx8VTUy8SaApLI e32MCjM Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 21 Jan 2017 22:15:33 +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 places. Signed-off-by: Markus Elfring Reviewed-by: Johannes Thumshirn --- block/blk-throttle.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index b392b48310ba..3cf7472fbba2 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -866,10 +866,12 @@ static void tg_update_disptime(struct throtl_grp *tg) unsigned long read_wait = -1, write_wait = -1, min_wait = -1, disptime; struct bio *bio; - if ((bio = throtl_peek_queued(&sq->queued[READ]))) + bio = throtl_peek_queued(&sq->queued[READ]); + if (bio) tg_may_dispatch(tg, bio, &read_wait); - if ((bio = throtl_peek_queued(&sq->queued[WRITE]))) + bio = throtl_peek_queued(&sq->queued[WRITE]); + if (bio) tg_may_dispatch(tg, bio, &write_wait); min_wait = min(read_wait, write_wait);