Messages in this thread Patch in this message | | | Subject | [PATCH 31/54] md/raid5: Adjust two function calls together with a variable assignment | From | SF Markus Elfring <> | Date | Thu, 6 Oct 2016 11:31:11 +0200 |
| |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 5 Oct 2016 10:00:07 +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@users.sourceforge.net> --- drivers/md/raid5.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index ef180c0..a37f1f9 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -501,11 +501,10 @@ static int grow_buffers(struct stripe_head *sh, gfp_t gfp) int num = sh->raid_conf->pool_size; for (i = 0; i < num; i++) { - struct page *page; + struct page *page = alloc_page(gfp); - if (!(page = alloc_page(gfp))) { + if (!page) return 1; - } sh->dev[i].page = page; sh->dev[i].orig_page = page; } @@ -6525,8 +6524,8 @@ static struct r5conf *setup_conf(struct mddev *mddev) goto free_conf; conf->mddev = mddev; - - if ((conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL)) == NULL) + conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL); + if (!conf->stripe_hashtbl) goto free_conf; /* We init hash_locks[0] separately to that it can be used -- 2.10.1
| |