[PATCH 04/16] md/bitmap: Improve another size determination in bitmap_storage_alloc()

From: SF Markus Elfring
Date: Tue Sep 27 2016 - 12:50:24 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Sep 2016 14:19:00 +0200

Replace the specification of a data type by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/md/bitmap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 9b3f723..c278865 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -791,9 +791,9 @@ static int bitmap_storage_alloc(struct bitmap_storage *store,

/* We need 4 bits per page, rounded up to a multiple
* of sizeof(unsigned long) */
- store->filemap_attr = kzalloc(
- roundup(DIV_ROUND_UP(num_pages*4, 8), sizeof(unsigned long)),
- GFP_KERNEL);
+ store->filemap_attr = kzalloc(roundup(DIV_ROUND_UP(num_pages * 4, 8),
+ sizeof(*store->filemap_attr)),
+ GFP_KERNEL);
if (!store->filemap_attr)
return -ENOMEM;

--
2.10.0