soundwire: intel: Use kzalloc for allocating only one thing
authorZheng Yongjun <zhengyongjun3@huawei.com>
Tue, 29 Dec 2020 13:50:12 +0000 (21:50 +0800)
committerVinod Koul <vkoul@kernel.org>
Wed, 6 Jan 2021 06:00:02 +0000 (11:30 +0530)
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
@@

- kcalloc(1,
+ kzalloc(
          ...)
// </smpl>

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20201229135012.23472-1-zhengyongjun3@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/intel.c

index 66adb25..10b60b7 100644 (file)
@@ -967,7 +967,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
        }
 
        /* Port configuration */
-       pconfig = kcalloc(1, sizeof(*pconfig), GFP_KERNEL);
+       pconfig = kzalloc(sizeof(*pconfig), GFP_KERNEL);
        if (!pconfig) {
                ret =  -ENOMEM;
                goto error;