Re: [Intel-gfx] [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types

2020-05-19 Thread Zhenyu Wang
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 > Reviewed-by: Chris Wilson Applied, thanks! --

Re: [Intel-gfx] [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types

2020-05-18 Thread Chris Wilson
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 Reviewed-by: Chris Wilson -Chris ___ Intel-gfx mailing list Intel-g

[Intel-gfx] [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types

2020-05-18 Thread Aishwarya Ramakrishnan
Prefer ARRAY_SIZE instead of using sizeof Fixes coccicheck warning: Use ARRAY_SIZE Signed-off-by: Aishwarya Ramakrishnan --- 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 inde

Re: [Intel-gfx] [PATCH] drm/i915/gvt: Use ARRAY_SIZE instead of hardcoded size

2020-04-13 Thread Joe Perches
On Mon, 2020-04-13 at 22:32 +0800, Jason Yan wrote: > Fix the following coccicheck warning: > > drivers/gpu/drm/i915/gvt/vgpu.c:127:30-31: WARNING: Use ARRAY_SIZE > > Signed-off-by: Jason Yan > --- > drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > di

[Intel-gfx] [PATCH] drm/i915/gvt: Use ARRAY_SIZE instead of hardcoded size

2020-04-13 Thread Jason Yan
Fix the following coccicheck warning: drivers/gpu/drm/i915/gvt/vgpu.c:127:30-31: WARNING: Use ARRAY_SIZE Signed-off-by: Jason Yan --- 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/vg

Re: [Intel-gfx] [PATCH] drm/i915/gvt: use ARRAY_SIZE

2017-10-23 Thread Zhi Wang
Thanks, applied! On 10/16/17 10:32, Jérémy Lefaure wrote: Using the ARRAY_SIZE macro improves the readability of the code. Also, it's useless to use a variable to store this constant calculated at compile time. Found with Coccinelle with the following semantic patch: @r depends on (org || repor

Re: [Intel-gfx] [PATCH] drm/i915/gvt: use ARRAY_SIZE

2017-10-16 Thread Wang, Zhi A
LGTM and Thanks for the patch! Reviewed-by: Zhi Wang -Original Message- From: Jani Nikula [mailto:jani.nik...@linux.intel.com] Sent: Monday, October 16, 2017 12:35 PM To: Jérémy Lefaure ; Zhenyu Wang ; Wang, Zhi A ; Joonas Lahtinen ; Vivi, Rodrigo Cc: Jérémy Lefaure ; intel-gvt-...@

Re: [Intel-gfx] [PATCH] drm/i915/gvt: use ARRAY_SIZE

2017-10-16 Thread Jani Nikula
[dropped a number of lists and maintainers, please use common sense] On Sun, 15 Oct 2017, Jérémy Lefaure wrote: > Using the ARRAY_SIZE macro improves the readability of the code. Also, > it's useless to use a variable to store this constant calculated at > compile time. I'll leave it up to Zhen

[Intel-gfx] [PATCH] drm/i915/gvt: use ARRAY_SIZE

2017-10-15 Thread Jérémy Lefaure
Using the ARRAY_SIZE macro improves the readability of the code. Also, it's useless to use a variable to store this constant calculated at compile time. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)