diff options
author | Thierry Reding <treding@nvidia.com> | 2014-12-10 13:03:36 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-12-10 14:13:40 +0100 |
commit | 2f6c538924108fbffb72a0696f28537b364080fa (patch) | |
tree | bf91d49ae4ffa1db74506a4c793e6a42f9b23e2f | |
parent | bd3f0ff98a849e04dc2c0236f32cc75b8c8630db (diff) | |
download | op-kernel-dev-2f6c538924108fbffb72a0696f28537b364080fa.zip op-kernel-dev-2f6c538924108fbffb72a0696f28537b364080fa.tar.gz |
drm: Prefer kmalloc_array() over kmalloc() with multiply
Fixes a couple of checkpatch warnings regarding the use of kmalloc()
with a multiplication. kmalloc_array() is the preferred API.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 45e17df..0d3a410 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1174,8 +1174,8 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, plane->base.properties = &plane->properties; plane->dev = dev; plane->funcs = funcs; - plane->format_types = kmalloc(sizeof(uint32_t) * format_count, - GFP_KERNEL); + plane->format_types = kmalloc_array(format_count, sizeof(uint32_t), + GFP_KERNEL); if (!plane->format_types) { DRM_DEBUG_KMS("out of memory when allocating plane\n"); drm_mode_object_put(dev, &plane->base); @@ -2705,9 +2705,9 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, goto out; } - connector_set = kmalloc(crtc_req->count_connectors * - sizeof(struct drm_connector *), - GFP_KERNEL); + connector_set = kmalloc_array(crtc_req->count_connectors, + sizeof(struct drm_connector *), + GFP_KERNEL); if (!connector_set) { ret = -ENOMEM; goto out; |