]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
bus: ti-sysc: Use kzalloc for allocating only one thing
authorZheng Yongjun <zhengyongjun3@huawei.com>
Tue, 29 Dec 2020 13:51:47 +0000 (21:51 +0800)
committerTony Lindgren <tony@atomide.com>
Wed, 24 Mar 2021 11:44:04 +0000 (13:44 +0200)
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>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/bus/ti-sysc.c

index cd32eaff3d835504ba2a8ec35b3975c56e32f716..8880259b41ae3e4698b1c52b47e2dd597f8c4926 100644 (file)
@@ -288,7 +288,7 @@ static int sysc_add_named_clock_from_child(struct sysc *ddata,
         * limit for clk_get(). If cl ever needs to be freed, it should be done
         * with clkdev_drop().
         */
-       cl = kcalloc(1, sizeof(*cl), GFP_KERNEL);
+       cl = kzalloc(sizeof(*cl), GFP_KERNEL);
        if (!cl)
                return -ENOMEM;