提交 3036d0e2 编写于 作者: K Karthik Tummala 提交者: Greg Kroah-Hartman

Staging: greybus: light: Prefer kcalloc over kzalloc

Fixed following checkpatch.pl warning:
 * WARNING: Prefer kcalloc over kzalloc with multiply

Instead of specifying no.of bytes * size as argument
in kzalloc, prefer kcalloc.
Signed-off-by: NKarthik Tummala <karthik@techveda.org>
Reviewed-by: NRui Miguel Silva <rmfrfs@gmail.com>
Acked-by: NViresh Kumar <viresh.kumar@linaro.org>

Changes for v2:
- Changed subject line & fixed typo as suggested by
  Rui Miguel Silva
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 10000711
...@@ -1030,7 +1030,7 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id) ...@@ -1030,7 +1030,7 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id)
light->channels_count = conf.channel_count; light->channels_count = conf.channel_count;
light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL); light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL);
light->channels = kzalloc(light->channels_count * light->channels = kcalloc(light->channels_count,
sizeof(struct gb_channel), GFP_KERNEL); sizeof(struct gb_channel), GFP_KERNEL);
if (!light->channels) if (!light->channels)
return -ENOMEM; return -ENOMEM;
...@@ -1167,7 +1167,7 @@ static int gb_lights_create_all(struct gb_lights *glights) ...@@ -1167,7 +1167,7 @@ static int gb_lights_create_all(struct gb_lights *glights)
if (ret < 0) if (ret < 0)
goto out; goto out;
glights->lights = kzalloc(glights->lights_count * glights->lights = kcalloc(glights->lights_count,
sizeof(struct gb_light), GFP_KERNEL); sizeof(struct gb_light), GFP_KERNEL);
if (!glights->lights) { if (!glights->lights) {
ret = -ENOMEM; ret = -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册