[PATCH 31/54] md/raid5: Adjust two function calls together with a variable assignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux