diff options
author | Elise Lennion <elise.lennion@gmail.com> | 2016-10-12 14:14:14 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-16 10:27:23 +0200 |
commit | c4fc2ebcbf762a1fe827931d670452aa27abef00 (patch) | |
tree | d9470f9d2742a852f3472daec0cf41e1fcfc482f | |
parent | 9d3318f48ce383cdd261719f4fa95c979bdd7ce4 (diff) | |
download | linux-c4fc2ebcbf762a1fe827931d670452aa27abef00.tar.gz linux-c4fc2ebcbf762a1fe827931d670452aa27abef00.tar.bz2 linux-c4fc2ebcbf762a1fe827931d670452aa27abef00.zip |
staging: greybus: camera: Use kcalloc for array's memory allocation.
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>
-rw-r--r-- | drivers/staging/greybus/camera.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 0c73445737b5..1c5b41ae6774 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -797,7 +797,7 @@ static int gb_camera_op_configure_streams(void *priv, unsigned int *nstreams, 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; @@ -938,7 +938,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, 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; |