aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus
diff options
context:
space:
mode:
authorZheng Yongjun <zhengyongjun3@huawei.com>2020-12-30 09:37:06 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-05 15:26:43 +0100
commit6500966d211c4a265600b4561d9c479088fce0a1 (patch)
treeabe9c6cd090cd71def3d93f36df3d57723c3457e /drivers/staging/greybus
parent1f82c33205db389007d2dd44ffdc124a24b9108f (diff)
staging: greybus: light: Use kzalloc for allocating only one thing
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> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Link: https://lore.kernel.org/r/20201230013706.28698-1-zhengyongjun3@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r--drivers/staging/greybus/light.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index d2672b65c3f4..87d36948c610 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -290,8 +290,7 @@ static int channel_attr_groups_set(struct gb_channel *channel,
channel->attrs = kcalloc(size + 1, sizeof(*channel->attrs), GFP_KERNEL);
if (!channel->attrs)
return -ENOMEM;
- channel->attr_group = kcalloc(1, sizeof(*channel->attr_group),
- GFP_KERNEL);
+ channel->attr_group = kzalloc(sizeof(*channel->attr_group), GFP_KERNEL);
if (!channel->attr_group)
return -ENOMEM;
channel->attr_groups = kcalloc(2, sizeof(*channel->attr_groups),

Privacy Policy