lkml.org 
[lkml]   [2016]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 07/16] md/bitmap: Replace a kzalloc() call by kcalloc() in bitmap_resize()
    From
    Date
    From: Markus Elfring <elfring@users.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@users.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
    \
     
     \ /
      Last update: 2016-09-27 18:56    [W:4.022 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site