staging: erofs: Replace kzalloc(struct ..) with kzalloc(*ptr)
PATCH 1/1 staging: erofs: Replace kzalloc(struct ..) with kzalloc(*ptr)
Resolve checkpatch warning:
Prefer kzalloc(sizeof(*ptr)...) over kzalloc(sizeof(struct ..)
Signed-off-by Shobhit Kukreti <shobhitkukreti at gmail.com>
--- drivers/staging/erofs/super.c | 2 +- drivers/staging/erofs/unzip_vle.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/staging/erofs/super.c +1 -1
@@ -383,7 +383,7 @@ static int erofs_read_super(struct super_block *sb, goto err; } - sbi =kzalloc (sizeof (struct erofs_sb_info ),GFP_KERNEL ); + sbi =kzalloc (sizeof (*sbi),GFP_KERNEL );if (unlikely (!sbi)) { err = -ENOMEM ; goto err;
drivers/staging/erofs/unzip_vle.c +1 -2
@@ -1263,8 +1263,7 @@ jobqueue_init(struct super_block *sb, goto out; } - iosb =kvzalloc (sizeof (struct z_erofs_vle_unzip_io_sb ), -GFP_KERNEL | __GFP_NOFAIL); + iosb =kvzalloc (sizeof (*iosb),GFP_KERNEL | __GFP_NOFAIL);DBG_BUGON (!iosb);/* initialize fields in the allocated descriptor */
Signature · 1 line
2.7.4
PATCH 1/1 staging: erofs: Replace kzalloc(struct ..) with kzalloc(*ptr)
Quoted 4 lines · Shobhit Kukreti
Resolve checkpatch warning:
Prefer kzalloc(sizeof(*ptr)...) over kzalloc(sizeof(struct ..)Signed-off-by Shobhit Kukreti <shobhitkukreti at gmail.com>
seems a new rule...
Reviewed-by Gao Xiang <gaoxiang25 at huawei.com>
Thanks,
Gao Xiang
PATCH 1/1 staging: erofs: Replace kzalloc(struct ..) with kzalloc(*ptr)
In reply to Shobhit KukretiQuoted 4 lines · Shobhit Kukreti
Resolve checkpatch warning:
Prefer kzalloc(sizeof(*ptr)...) over kzalloc(sizeof(struct ..)Signed-off-by Shobhit Kukreti <shobhitkukreti at gmail.com>
Reviewed-by Chao Yu <yuchao0 at huawei.com>
Thanks,