[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7345990e-3c59-de68-f07b-8b68458b6cf3@users.sourceforge.net>
Date: Tue, 27 Sep 2016 18:54:39 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-raid@...r.kernel.org, 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 07/16] md/bitmap: Replace a kzalloc() call by kcalloc() in
bitmap_resize()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 27 Sep 2016 15:26:51 +0200
The script "checkpatch.pl" can point information out like the following.
WARNING: Prefer kcalloc over kzalloc with multiply
Thus fix the affected source code place.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/md/bitmap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 2d30c83..41d99fd 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -2035,8 +2035,7 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
return ret;
pages = DIV_ROUND_UP(chunks, PAGE_COUNTER_RATIO);
-
- new_bp = kzalloc(pages * sizeof(*new_bp), GFP_KERNEL);
+ new_bp = kcalloc(pages, sizeof(*new_bp), GFP_KERNEL);
if (!new_bp) {
bitmap_file_unmap(&store);
return -ENOMEM;
--
2.10.0
Powered by blists - more mailing lists