OSDN Git Service

cfq-iosched: Adjust one function call together with a variable assignment
authorMarkus Elfring <elfring@users.sourceforge.net>
Sat, 21 Jan 2017 21:44:07 +0000 (22:44 +0100)
committer0ranko0P <ranko0p@outlook.com>
Wed, 4 Dec 2019 13:47:56 +0000 (21:47 +0800)
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 <elfring@users.sourceforge.net>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/cfq-iosched.c

index 8ad8a73..f636c12 100644 (file)
@@ -2743,9 +2743,11 @@ static struct cfq_queue *cfq_get_next_queue_forced(struct cfq_data *cfqd)
        if (!cfqg)
                return NULL;
 
-       for_each_cfqg_st(cfqg, i, j, st)
-               if ((cfqq = cfq_rb_first(st)) != NULL)
+       for_each_cfqg_st(cfqg, i, j, st) {
+               cfqq = cfq_rb_first(st);
+               if (cfqq)
                        return cfqq;
+       }
        return NULL;
 }