Commit 9ac04a87 authored by Navya Sri Nizamkari's avatar Navya Sri Nizamkari Committed by Greg Kroah-Hartman

staging: media: Use kcalloc instead of kzalloc.

This patch uses kcalloc instead of kzalloc function.
A coccinelle script was used to make this change.
Signed-off-by: default avatarNavya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5869066a
...@@ -226,8 +226,8 @@ static int vpfe_enable_clock(struct vpfe_device *vpfe_dev) ...@@ -226,8 +226,8 @@ static int vpfe_enable_clock(struct vpfe_device *vpfe_dev)
if (!vpfe_cfg->num_clocks) if (!vpfe_cfg->num_clocks)
return 0; return 0;
vpfe_dev->clks = kzalloc(vpfe_cfg->num_clocks * vpfe_dev->clks = kcalloc(vpfe_cfg->num_clocks,
sizeof(struct clock *), GFP_KERNEL); sizeof(struct clock *), GFP_KERNEL);
if (vpfe_dev->clks == NULL) if (vpfe_dev->clks == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -346,7 +346,8 @@ static int register_i2c_devices(struct vpfe_device *vpfe_dev) ...@@ -346,7 +346,8 @@ static int register_i2c_devices(struct vpfe_device *vpfe_dev)
i2c_adap = i2c_get_adapter(1); i2c_adap = i2c_get_adapter(1);
num_subdevs = vpfe_cfg->num_subdevs; num_subdevs = vpfe_cfg->num_subdevs;
vpfe_dev->sd = vpfe_dev->sd =
kzalloc(sizeof(struct v4l2_subdev *)*num_subdevs, GFP_KERNEL); kcalloc(num_subdevs, sizeof(struct v4l2_subdev *),
GFP_KERNEL);
if (vpfe_dev->sd == NULL) if (vpfe_dev->sd == NULL)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment