dlm: Improve a size determination in two functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Sat, 6 May 2017 07:45:59 +0000 (09:45 +0200)
committerDavid Teigland <teigland@redhat.com>
Mon, 7 Aug 2017 16:23:09 +0000 (11:23 -0500)
Replace the specification of two data structures by pointer dereferences
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>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/member.c

index 92c601a11e385aadf3ade22e208581afcf5f09d2..3e565034ff2e57444ce8f742bd492b430b0dab20 100644 (file)
@@ -318,7 +318,7 @@ static int dlm_add_member(struct dlm_ls *ls, struct dlm_config_node *node)
        struct dlm_member *memb;
        int error;
 
-       memb = kzalloc(sizeof(struct dlm_member), GFP_NOFS);
+       memb = kzalloc(sizeof(*memb), GFP_NOFS);
        if (!memb)
                return -ENOMEM;
 
@@ -674,7 +674,7 @@ int dlm_ls_start(struct dlm_ls *ls)
        struct dlm_config_node *nodes;
        int error, count;
 
-       rv = kzalloc(sizeof(struct dlm_recover), GFP_NOFS);
+       rv = kzalloc(sizeof(*rv), GFP_NOFS);
        if (!rv)
                return -ENOMEM;