staging: erofs: Replace kzalloc(struct ..) with kzalloc(*ptr)
authorShobhit Kukreti <shobhitkukreti@gmail.com>
Thu, 27 Jun 2019 05:31:18 +0000 (22:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jul 2019 06:45:04 +0000 (08:45 +0200)
Resolve checkpatch warning:
Prefer kzalloc(sizeof(*ptr)...) over kzalloc(sizeof(struct ..)

Signed-off-by: Shobhit Kukreti <shobhitkukreti@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/super.c
drivers/staging/erofs/unzip_vle.c

index cadbcc11702aa7a0eb5f914478e9eed5ad5e9351..54494412eba4189fa64844d5a4ef207e5ac74e51 100644 (file)
@@ -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;
index 316382d33783ae2b5b520c186d361936ecc46f29..f0dab81ff8167f89d1bd21241abbed335dd810cd 100644 (file)
@@ -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 */