Fix checkpatch warning:
WARNING: Prefer kcalloc over kzalloc with multiply
kcalloc is designed to allocate memory for arrays, its use is
preferable than kzalloc in these cases.
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (gb_nstreams > GB_CAMERA_MAX_STREAMS)
return -EINVAL;
- gb_streams = kzalloc(gb_nstreams * sizeof(*gb_streams), GFP_KERNEL);
+ gb_streams = kcalloc(gb_nstreams, sizeof(*gb_streams), GFP_KERNEL);
if (!gb_streams)
return -ENOMEM;
return ret;
/* For each stream to configure parse width, height and format */
- streams = kzalloc(nstreams * sizeof(*streams), GFP_KERNEL);
+ streams = kcalloc(nstreams, sizeof(*streams), GFP_KERNEL);
if (!streams)
return -ENOMEM;