All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/i915/gvt: cleanup a type issue in submit_context()
@ 2016-10-21  8:06 ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2016-10-21  8:06 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: dri-devel, intel-gfx, kernel-janitors, Yulei Zhang, Zhi Wang

submit_context() should return negative error codes and zero on success
but by mistake we made it a bool.  I've changed it to int.  Also I made
it static because this isn't referenced in any other files.

This doesn't affect runtime because the return is eventually propogated
to elsp_mmio_write() where it is ignored.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
index c50a3d1a5131..bc69ba1842ea 100644
--- a/drivers/gpu/drm/i915/gvt/execlist.c
+++ b/drivers/gpu/drm/i915/gvt/execlist.c
@@ -616,7 +616,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload)
 	(list_empty(q) ? NULL : container_of(q->prev, \
 	struct intel_vgpu_workload, list))
 
-bool submit_context(struct intel_vgpu *vgpu, int ring_id,
+static int submit_context(struct intel_vgpu *vgpu, int ring_id,
 		struct execlist_ctx_descriptor_format *desc,
 		bool emulate_schedule_in)
 {

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [patch] drm/i915/gvt: cleanup a type issue in submit_context()
@ 2016-10-21  8:06 ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2016-10-21  8:06 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: dri-devel, intel-gfx, kernel-janitors, Yulei Zhang, Zhi Wang

submit_context() should return negative error codes and zero on success
but by mistake we made it a bool.  I've changed it to int.  Also I made
it static because this isn't referenced in any other files.

This doesn't affect runtime because the return is eventually propogated
to elsp_mmio_write() where it is ignored.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
index c50a3d1a5131..bc69ba1842ea 100644
--- a/drivers/gpu/drm/i915/gvt/execlist.c
+++ b/drivers/gpu/drm/i915/gvt/execlist.c
@@ -616,7 +616,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload)
 	(list_empty(q) ? NULL : container_of(q->prev, \
 	struct intel_vgpu_workload, list))
 
-bool submit_context(struct intel_vgpu *vgpu, int ring_id,
+static int submit_context(struct intel_vgpu *vgpu, int ring_id,
 		struct execlist_ctx_descriptor_format *desc,
 		bool emulate_schedule_in)
 {
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [patch] drm/i915/gvt: cleanup a type issue in submit_context()
  2016-10-21  8:06 ` Dan Carpenter
@ 2016-10-21  8:27   ` Zhenyu Wang
  -1 siblings, 0 replies; 10+ messages in thread
From: Zhenyu Wang @ 2016-10-21  8:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Daniel Vetter, Jani Nikula, David Airlie, Zhenyu Wang, Zhi Wang,
	Yulei Zhang, intel-gfx, dri-devel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

On 2016.10.21 11:06:01 +0300, Dan Carpenter wrote:
> submit_context() should return negative error codes and zero on success
> but by mistake we made it a bool.  I've changed it to int.  Also I made
> it static because this isn't referenced in any other files.
> 
> This doesn't affect runtime because the return is eventually propogated
> to elsp_mmio_write() where it is ignored.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
> index c50a3d1a5131..bc69ba1842ea 100644
> --- a/drivers/gpu/drm/i915/gvt/execlist.c
> +++ b/drivers/gpu/drm/i915/gvt/execlist.c
> @@ -616,7 +616,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload)
>  	(list_empty(q) ? NULL : container_of(q->prev, \
>  	struct intel_vgpu_workload, list))
>  
> -bool submit_context(struct intel_vgpu *vgpu, int ring_id,
> +static int submit_context(struct intel_vgpu *vgpu, int ring_id,
>  		struct execlist_ctx_descriptor_format *desc,
>  		bool emulate_schedule_in)
>  {

Dan, this has been fixed in our recent pull, should hit linux-next very soon.

thanks

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch] drm/i915/gvt: cleanup a type issue in submit_context()
@ 2016-10-21  8:27   ` Zhenyu Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Zhenyu Wang @ 2016-10-21  8:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Daniel Vetter, Jani Nikula, David Airlie, Zhenyu Wang, Zhi Wang,
	Yulei Zhang, intel-gfx, dri-devel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

On 2016.10.21 11:06:01 +0300, Dan Carpenter wrote:
> submit_context() should return negative error codes and zero on success
> but by mistake we made it a bool.  I've changed it to int.  Also I made
> it static because this isn't referenced in any other files.
> 
> This doesn't affect runtime because the return is eventually propogated
> to elsp_mmio_write() where it is ignored.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
> index c50a3d1a5131..bc69ba1842ea 100644
> --- a/drivers/gpu/drm/i915/gvt/execlist.c
> +++ b/drivers/gpu/drm/i915/gvt/execlist.c
> @@ -616,7 +616,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload)
>  	(list_empty(q) ? NULL : container_of(q->prev, \
>  	struct intel_vgpu_workload, list))
>  
> -bool submit_context(struct intel_vgpu *vgpu, int ring_id,
> +static int submit_context(struct intel_vgpu *vgpu, int ring_id,
>  		struct execlist_ctx_descriptor_format *desc,
>  		bool emulate_schedule_in)
>  {

Dan, this has been fixed in our recent pull, should hit linux-next very soon.

thanks

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Intel-gfx] [patch] drm/i915/gvt: cleanup a type issue in submit_context()
  2016-10-21  8:06 ` Dan Carpenter
@ 2016-10-21  8:33   ` Chris Wilson
  -1 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2016-10-21  8:33 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Daniel Vetter, dri-devel, David Airlie, intel-gfx, kernel-janitors

On Fri, Oct 21, 2016 at 11:06:01AM +0300, Dan Carpenter wrote:
> submit_context() should return negative error codes and zero on success
> but by mistake we made it a bool.  I've changed it to int.  Also I made
> it static because this isn't referenced in any other files.
> 
> This doesn't affect runtime because the return is eventually propogated
> to elsp_mmio_write() where it is ignored.

Thanks Dan, your work in finding these is always appreciated (as is
smatch!)

Should be fixed by

commit 76a79d59ada00fa22e5f8cd94b36296f395c3406
Author: Du, Changbin <changbin.du@intel.com>
Date:   Thu Oct 20 14:08:48 2016 +0800

    drm/i915/gvt: fix spare warnings on odd constant _Bool cast
    
    The function return values should has type int if it return
    a integer value.

-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Intel-gfx] [patch] drm/i915/gvt: cleanup a type issue in submit_context()
@ 2016-10-21  8:33   ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2016-10-21  8:33 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Daniel Vetter, dri-devel, David Airlie, intel-gfx, kernel-janitors

On Fri, Oct 21, 2016 at 11:06:01AM +0300, Dan Carpenter wrote:
> submit_context() should return negative error codes and zero on success
> but by mistake we made it a bool.  I've changed it to int.  Also I made
> it static because this isn't referenced in any other files.
> 
> This doesn't affect runtime because the return is eventually propogated
> to elsp_mmio_write() where it is ignored.

Thanks Dan, your work in finding these is always appreciated (as is
smatch!)

Should be fixed by

commit 76a79d59ada00fa22e5f8cd94b36296f395c3406
Author: Du, Changbin <changbin.du@intel.com>
Date:   Thu Oct 20 14:08:48 2016 +0800

    drm/i915/gvt: fix spare warnings on odd constant _Bool cast
    
    The function return values should has type int if it return
    a integer value.

-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch] drm/i915/gvt: cleanup a type issue in submit_context()
  2016-10-21  8:27   ` Zhenyu Wang
@ 2016-10-21 10:27     ` Dan Carpenter
  -1 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2016-10-21 10:27 UTC (permalink / raw)
  To: Zhenyu Wang
  Cc: Daniel Vetter, Jani Nikula, David Airlie, Zhi Wang, Yulei Zhang,
	intel-gfx, dri-devel, kernel-janitors

On Fri, Oct 21, 2016 at 04:27:38PM +0800, Zhenyu Wang wrote:
> On 2016.10.21 11:06:01 +0300, Dan Carpenter wrote:
> > submit_context() should return negative error codes and zero on success
> > but by mistake we made it a bool.  I've changed it to int.  Also I made
> > it static because this isn't referenced in any other files.
> > 
> > This doesn't affect runtime because the return is eventually propogated
> > to elsp_mmio_write() where it is ignored.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
> > index c50a3d1a5131..bc69ba1842ea 100644
> > --- a/drivers/gpu/drm/i915/gvt/execlist.c
> > +++ b/drivers/gpu/drm/i915/gvt/execlist.c
> > @@ -616,7 +616,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload)
> >  	(list_empty(q) ? NULL : container_of(q->prev, \
> >  	struct intel_vgpu_workload, list))
> >  
> > -bool submit_context(struct intel_vgpu *vgpu, int ring_id,
> > +static int submit_context(struct intel_vgpu *vgpu, int ring_id,
> >  		struct execlist_ctx_descriptor_format *desc,
> >  		bool emulate_schedule_in)
> >  {
> 
> Dan, this has been fixed in our recent pull, should hit linux-next very soon.
> 

Could you review elsp_mmio_write() as well?  Should we be doing
something with that return value?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch] drm/i915/gvt: cleanup a type issue in submit_context()
@ 2016-10-21 10:27     ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2016-10-21 10:27 UTC (permalink / raw)
  To: Zhenyu Wang
  Cc: Daniel Vetter, Jani Nikula, David Airlie, Zhi Wang, Yulei Zhang,
	intel-gfx, dri-devel, kernel-janitors

On Fri, Oct 21, 2016 at 04:27:38PM +0800, Zhenyu Wang wrote:
> On 2016.10.21 11:06:01 +0300, Dan Carpenter wrote:
> > submit_context() should return negative error codes and zero on success
> > but by mistake we made it a bool.  I've changed it to int.  Also I made
> > it static because this isn't referenced in any other files.
> > 
> > This doesn't affect runtime because the return is eventually propogated
> > to elsp_mmio_write() where it is ignored.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
> > index c50a3d1a5131..bc69ba1842ea 100644
> > --- a/drivers/gpu/drm/i915/gvt/execlist.c
> > +++ b/drivers/gpu/drm/i915/gvt/execlist.c
> > @@ -616,7 +616,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload)
> >  	(list_empty(q) ? NULL : container_of(q->prev, \
> >  	struct intel_vgpu_workload, list))
> >  
> > -bool submit_context(struct intel_vgpu *vgpu, int ring_id,
> > +static int submit_context(struct intel_vgpu *vgpu, int ring_id,
> >  		struct execlist_ctx_descriptor_format *desc,
> >  		bool emulate_schedule_in)
> >  {
> 
> Dan, this has been fixed in our recent pull, should hit linux-next very soon.
> 

Could you review elsp_mmio_write() as well?  Should we be doing
something with that return value?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch] drm/i915/gvt: cleanup a type issue in submit_context()
  2016-10-21 10:27     ` Dan Carpenter
@ 2016-10-21 12:27       ` Zhenyu Wang
  -1 siblings, 0 replies; 10+ messages in thread
From: Zhenyu Wang @ 2016-10-21 12:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Daniel Vetter, Jani Nikula, David Airlie, Zhi Wang, Yulei Zhang,
	intel-gfx, dri-devel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1724 bytes --]

On 2016.10.21 13:27:22 +0300, Dan Carpenter wrote:
> On Fri, Oct 21, 2016 at 04:27:38PM +0800, Zhenyu Wang wrote:
> > On 2016.10.21 11:06:01 +0300, Dan Carpenter wrote:
> > > submit_context() should return negative error codes and zero on success
> > > but by mistake we made it a bool.  I've changed it to int.  Also I made
> > > it static because this isn't referenced in any other files.
> > > 
> > > This doesn't affect runtime because the return is eventually propogated
> > > to elsp_mmio_write() where it is ignored.
> > > 
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > 
> > > diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
> > > index c50a3d1a5131..bc69ba1842ea 100644
> > > --- a/drivers/gpu/drm/i915/gvt/execlist.c
> > > +++ b/drivers/gpu/drm/i915/gvt/execlist.c
> > > @@ -616,7 +616,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload)
> > >  	(list_empty(q) ? NULL : container_of(q->prev, \
> > >  	struct intel_vgpu_workload, list))
> > >  
> > > -bool submit_context(struct intel_vgpu *vgpu, int ring_id,
> > > +static int submit_context(struct intel_vgpu *vgpu, int ring_id,
> > >  		struct execlist_ctx_descriptor_format *desc,
> > >  		bool emulate_schedule_in)
> > >  {
> > 
> > Dan, this has been fixed in our recent pull, should hit linux-next very soon.
> > 
> 
> Could you review elsp_mmio_write() as well?  Should we be doing
> something with that return value?
> 

yeah, ignore return value is not good, will fix that. Thanks!

Zhi, could you double check error path for elsp write?

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch] drm/i915/gvt: cleanup a type issue in submit_context()
@ 2016-10-21 12:27       ` Zhenyu Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Zhenyu Wang @ 2016-10-21 12:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Daniel Vetter, Jani Nikula, David Airlie, Zhi Wang, Yulei Zhang,
	intel-gfx, dri-devel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1724 bytes --]

On 2016.10.21 13:27:22 +0300, Dan Carpenter wrote:
> On Fri, Oct 21, 2016 at 04:27:38PM +0800, Zhenyu Wang wrote:
> > On 2016.10.21 11:06:01 +0300, Dan Carpenter wrote:
> > > submit_context() should return negative error codes and zero on success
> > > but by mistake we made it a bool.  I've changed it to int.  Also I made
> > > it static because this isn't referenced in any other files.
> > > 
> > > This doesn't affect runtime because the return is eventually propogated
> > > to elsp_mmio_write() where it is ignored.
> > > 
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > 
> > > diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
> > > index c50a3d1a5131..bc69ba1842ea 100644
> > > --- a/drivers/gpu/drm/i915/gvt/execlist.c
> > > +++ b/drivers/gpu/drm/i915/gvt/execlist.c
> > > @@ -616,7 +616,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload)
> > >  	(list_empty(q) ? NULL : container_of(q->prev, \
> > >  	struct intel_vgpu_workload, list))
> > >  
> > > -bool submit_context(struct intel_vgpu *vgpu, int ring_id,
> > > +static int submit_context(struct intel_vgpu *vgpu, int ring_id,
> > >  		struct execlist_ctx_descriptor_format *desc,
> > >  		bool emulate_schedule_in)
> > >  {
> > 
> > Dan, this has been fixed in our recent pull, should hit linux-next very soon.
> > 
> 
> Could you review elsp_mmio_write() as well?  Should we be doing
> something with that return value?
> 

yeah, ignore return value is not good, will fix that. Thanks!

Zhi, could you double check error path for elsp write?

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-10-21 12:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21  8:06 [patch] drm/i915/gvt: cleanup a type issue in submit_context() Dan Carpenter
2016-10-21  8:06 ` Dan Carpenter
2016-10-21  8:27 ` Zhenyu Wang
2016-10-21  8:27   ` Zhenyu Wang
2016-10-21 10:27   ` Dan Carpenter
2016-10-21 10:27     ` Dan Carpenter
2016-10-21 12:27     ` Zhenyu Wang
2016-10-21 12:27       ` Zhenyu Wang
2016-10-21  8:33 ` [Intel-gfx] " Chris Wilson
2016-10-21  8:33   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.