[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <383b0acc-a093-fe89-c21d-d9a86761976b@users.sourceforge.net>
Date: Sun, 2 Oct 2016 14:05:12 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-raid@...r.kernel.org, Jens Axboe <axboe@...com>,
NeilBrown <neilb@...e.com>, Shaohua Li <shli@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 9/13] md/multipath: Adjust two function calls together with a
variable assignment
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 2 Oct 2016 10:05:43 +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 places.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/md/multipath.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 0e8939f..a5a639d 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -258,8 +258,9 @@ static int multipath_add_disk(struct mddev *mddev, struct md_rdev *rdev)
print_multipath_conf(conf);
- for (path = first; path <= last; path++)
- if ((p=conf->multipaths+path)->rdev == NULL) {
+ for (path = first; path <= last; path++) {
+ p = conf->multipaths + path;
+ if (!p->rdev) {
q = rdev->bdev->bd_disk->queue;
disk_stack_limits(mddev->gendisk, rdev->bdev,
rdev->data_offset << 9);
@@ -276,6 +277,7 @@ static int multipath_add_disk(struct mddev *mddev, struct md_rdev *rdev)
err = 0;
break;
}
+ }
print_multipath_conf(conf);
@@ -347,7 +349,8 @@ static void multipathd(struct md_thread *thread)
bio = &mp_bh->bio;
bio->bi_iter.bi_sector = mp_bh->master_bio->bi_iter.bi_sector;
- if ((mp_bh->path = multipath_map (conf))<0) {
+ mp_bh->path = multipath_map(conf);
+ if (mp_bh->path < 0) {
printk(KERN_ALERT "multipath: %s: unrecoverable IO read"
" error for block %llu\n",
bdevname(bio->bi_bdev,b),
--
2.10.0
Powered by blists - more mailing lists