linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/5] blk-throttle: Adjust two function calls together with a variable assignment
Date: Sun, 22 Jan 2017 09:33:08 +0100	[thread overview]
Message-ID: <7d68f93d-c14c-60aa-2b02-5005a0a62cad@users.sourceforge.net> (raw)
In-Reply-To: <e734cafa-eec0-9d5b-b368-2de496a96c80@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
 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);
-- 
2.11.0

  parent reply	other threads:[~2017-01-22  8:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22  8:30 [PATCH 0/5] block: Fine-tuning for five function implementations SF Markus Elfring
2017-01-22  8:31 ` [PATCH 1/5] blk-throttle: Move three assignments for the variable "ret" in tg_set_max() SF Markus Elfring
2017-01-23  9:15   ` Johannes Thumshirn
2017-01-23 10:00     ` SF Markus Elfring
2017-01-23 11:47       ` Johannes Thumshirn
2017-01-23 12:06         ` SF Markus Elfring
2017-01-23 15:17           ` Jens Axboe
2017-01-22  8:32 ` [PATCH 2/5] blk-throttle: Move an assignment for the variable "ret" in tg_set_conf() SF Markus Elfring
2017-01-23  9:16   ` Johannes Thumshirn
2017-01-22  8:33 ` SF Markus Elfring [this message]
2017-01-23  9:20   ` [PATCH 3/5] blk-throttle: Adjust two function calls together with a variable assignment Johannes Thumshirn
2017-01-23 15:14     ` Jens Axboe
2017-01-22  8:34 ` [PATCH 4/5] cfq-iosched: Move an assignment for the variable "ret" in __cfqg_set_weight_device() SF Markus Elfring
2017-01-22  8:35 ` [PATCH 5/5] cfq-iosched: Adjust one function call together with a variable assignment SF Markus Elfring
2017-01-23  9:21   ` Johannes Thumshirn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d68f93d-c14c-60aa-2b02-5005a0a62cad@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=axboe@kernel.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).