* [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types
@ 2020-05-18 15:03 Aishwarya Ramakrishnan
2020-05-18 21:00 ` Chris Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Aishwarya Ramakrishnan @ 2020-05-18 15:03 UTC (permalink / raw)
To: Zhenyu Wang, Zhi Wang, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, David Airlie, Daniel Vetter, intel-gvt-dev,
intel-gfx, dri-devel, linux-kernel
Cc: aishwaryarj100
Prefer ARRAY_SIZE instead of using sizeof
Fixes coccicheck warning: Use ARRAY_SIZE
Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
---
drivers/gpu/drm/i915/gvt/vgpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types
2020-05-18 15:03 [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types Aishwarya Ramakrishnan
@ 2020-05-18 21:00 ` Chris Wilson
2020-05-19 9:03 ` Zhenyu Wang
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2020-05-18 21:00 UTC (permalink / raw)
To: Aishwarya Ramakrishnan, Daniel Vetter, David Airlie, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Zhenyu Wang, Zhi Wang, dri-devel,
intel-gfx, intel-gvt-dev, linux-kernel
Cc: aishwaryarj100
Quoting Aishwarya Ramakrishnan (2020-05-18 16:03:36)
> Prefer ARRAY_SIZE instead of using sizeof
>
> Fixes coccicheck warning: Use ARRAY_SIZE
>
> Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types
2020-05-18 21:00 ` Chris Wilson
@ 2020-05-19 9:03 ` Zhenyu Wang
0 siblings, 0 replies; 3+ messages in thread
From: Zhenyu Wang @ 2020-05-19 9:03 UTC (permalink / raw)
To: Chris Wilson
Cc: David Airlie, intel-gvt-dev, dri-devel, linux-kernel,
Rodrigo Vivi, intel-gfx, Aishwarya Ramakrishnan, Zhi Wang
[-- Attachment #1.1: Type: text/plain, Size: 465 bytes --]
On 2020.05.18 22:00:52 +0100, Chris Wilson wrote:
> Quoting Aishwarya Ramakrishnan (2020-05-18 16:03:36)
> > Prefer ARRAY_SIZE instead of using sizeof
> >
> > Fixes coccicheck warning: Use ARRAY_SIZE
> >
> > Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Applied, thanks!
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-19 9:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 15:03 [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types Aishwarya Ramakrishnan
2020-05-18 21:00 ` Chris Wilson
2020-05-19 9:03 ` Zhenyu Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).