Re: [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! --

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

2020-05-19 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: [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 ___ dri-devel mailing list dri-dev

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

2020-04-14 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: [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

Re: [PATCH] drm/i915/gvt: Use ARRAY_SIZE macro

2018-06-18 Thread Joe Perches
On Mon, 2018-06-18 at 13:18 +0530, rajan.v...@gmail.com wrote: > Use ARRAY_SIZE instead of dividing sizeof array with sizeof > an element. This fixes below warning reported by Coccinelle: > drivers/gpu/drm//i915/gvt/vgpu.c:122:30-31: WARNING: Use ARRAY_SIZE [] > diff --git a/drivers/gpu/drm/i915/gv

[PATCH] drm/i915/gvt: Use ARRAY_SIZE macro

2018-06-18 Thread rajan . vaja
From: Rajan Vaja Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. This fixes below warning reported by Coccinelle: drivers/gpu/drm//i915/gvt/vgpu.c:122:30-31: WARNING: Use ARRAY_SIZE Signed-off-by: Rajan Vaja --- drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- 1 file changed, 1

Re: [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

[PATCH] drm/i915/gvt: use ARRAY_SIZE

2017-10-16 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)