Skip to content

Commit cb7ee52

Browse files
aishwaryarj100zhenyw
authored andcommitted
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 <[email protected]> Signed-off-by: Aishwarya Ramakrishnan <[email protected]> Signed-off-by: Zhenyu Wang <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1167886 commit cb7ee52

File tree

1 file changed

+1
-1
lines changed
  • drivers/gpu/drm/i915/gvt

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gvt/vgpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int intel_gvt_init_vgpu_types(struct intel_gvt *gvt)
124124
*/
125125
low_avail = gvt_aperture_sz(gvt) - HOST_LOW_GM_SIZE;
126126
high_avail = gvt_hidden_sz(gvt) - HOST_HIGH_GM_SIZE;
127-
num_types = sizeof(vgpu_types) / sizeof(vgpu_types[0]);
127+
num_types = ARRAY_SIZE(vgpu_types);
128128

129129
gvt->types = kcalloc(num_types, sizeof(struct intel_vgpu_type),
130130
GFP_KERNEL);

0 commit comments

Comments
 (0)