3 From: Markus Elfring <elfring@users.sourceforge.net>
5 Replace the specification of data structures by pointer dereferences
6 as the parameter for the operator "sizeof" to make the corresponding size
7 determination a bit safer according to the Linux coding style convention.
9 This issue was detected by using the Coccinelle software.
11 Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
12 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 Reviewed-by: Eric Sandeen <sandeen@redhat.com>
17 2 files changed, 2 insertions(+), 2 deletions(-)
19 diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
20 index e8b365000d73..b04e882179c6 100644
23 @@ -411,7 +411,7 @@ static struct dir_private_info *ext4_htree_create_dir_info(struct file *filp,
25 struct dir_private_info *p;
27 - p = kzalloc(sizeof(struct dir_private_info), GFP_KERNEL);
28 + p = kzalloc(sizeof(*p), GFP_KERNEL);
31 p->curr_hash = pos2maj_hash(filp, pos);
32 diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
33 index eb9835638680..77cdce1f17ce 100644
36 @@ -367,7 +367,7 @@ int ext4_multi_mount_protect(struct super_block *sb,
40 - mmpd_data = kmalloc(sizeof(struct mmpd_data), GFP_KERNEL);
41 + mmpd_data = kmalloc(sizeof(*mmpd_data), GFP_KERNEL);
43 ext4_warning(sb, "not enough memory for mmpd_data");