summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gvt/vgpu.c
diff options
context:
space:
mode:
authorAishwarya Ramakrishnan <aishwaryarj100@gmail.com>2020-05-18 18:03:36 +0300
committerZhenyu Wang <zhenyuw@linux.intel.com>2020-05-19 12:18:50 +0300
commitcb7ee52284a244fd14caec73df0d49e02891aac4 (patch)
tree77a681b9a2fe1fec84d9f29974b133faa83b160f /drivers/gpu/drm/i915/gvt/vgpu.c
parent116788689bf8ca3c3337d8dd1a742c08342d2f62 (diff)
downloadlinux-cb7ee52284a244fd14caec73df0d49e02891aac4.tar.xz
drm/i915/gvt: Use ARRAY_SIZE for vgpu_types
Prefer ARRAY_SIZE instead of using sizeof Fixes coccicheck warning: Use ARRAY_SIZE Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20200518150336.15265-1-aishwaryarj100@gmail.com
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/vgpu.c')
-rw-r--r--drivers/gpu/drm/i915/gvt/vgpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c
index 1d5ff88078bd..7d361623ff67 100644
--- a/drivers/gpu/drm/i915/gvt/vgpu.c
+++ b/drivers/gpu/drm/i915/gvt/vgpu.c
@@ -124,7 +124,7 @@ int intel_gvt_init_vgpu_types(struct intel_gvt *gvt)
*/
low_avail = gvt_aperture_sz(gvt) - HOST_LOW_GM_SIZE;
high_avail = gvt_hidden_sz(gvt) - HOST_HIGH_GM_SIZE;
- num_types = sizeof(vgpu_types) / sizeof(vgpu_types[0]);
+ num_types = ARRAY_SIZE(vgpu_types);
gvt->types = kcalloc(num_types, sizeof(struct intel_vgpu_type),
GFP_KERNEL);