lkml.org 
[lkml]   [2016]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 07/15] md-cluster: Improve another size determination in process_suspend_info()
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Sat, 1 Oct 2016 12:42:50 +0200

    Replace the specification of a data structure 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@users.sourceforge.net>
    ---
    drivers/md/md-cluster.c | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
    index 94835b5..e965e78 100644
    --- a/drivers/md/md-cluster.c
    +++ b/drivers/md/md-cluster.c
    @@ -482,8 +482,7 @@ static void process_suspend_info(struct mddev *mddev,
    lo, hi);
    cinfo->sync_low = lo;
    cinfo->sync_hi = hi;
    -
    - s = kzalloc(sizeof(struct suspend_info), GFP_KERNEL);
    + s = kzalloc(sizeof(*s), GFP_KERNEL);
    if (!s)
    return;
    s->slot = slot;
    --
    2.10.0
    \
     
     \ /
      Last update: 2016-10-01 16:52    [W:4.042 / U:1.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site