linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][drm-next] drm/vmwgfx: remove redundant return ret statement
@ 2018-10-04 17:49 Colin King
  2018-10-04 20:17 ` Sinclair Yeh
  2018-10-11  7:06 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2018-10-04 17:49 UTC (permalink / raw)
  To: VMware Graphics, Sinclair Yeh, Thomas Hellstrom, David Airlie, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The return statement is redundant as there is a return statement
immediately before it so we have dead code that can be removed.
Also remove the unused declaration of ret.

Detected by CoverityScan, CID#1473793 ("Structurally dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
index 5a6b70ba137a..260650bb5560 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
@@ -1738,7 +1738,6 @@ static int vmw_cmd_check_define_gmrfb(struct vmw_private *dev_priv,
 				      void *buf)
 {
 	struct vmw_buffer_object *vmw_bo;
-	int ret;
 
 	struct {
 		uint32_t header;
@@ -1748,7 +1747,6 @@ static int vmw_cmd_check_define_gmrfb(struct vmw_private *dev_priv,
 	return vmw_translate_guest_ptr(dev_priv, sw_context,
 				       &cmd->body.ptr,
 				       &vmw_bo);
-	return ret;
 }
 
 
-- 
2.17.1


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

* Re: [PATCH][drm-next] drm/vmwgfx: remove redundant return ret statement
  2018-10-04 17:49 [PATCH][drm-next] drm/vmwgfx: remove redundant return ret statement Colin King
@ 2018-10-04 20:17 ` Sinclair Yeh
  2018-10-11  7:06 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Sinclair Yeh @ 2018-10-04 20:17 UTC (permalink / raw)
  To: Colin King
  Cc: linux-graphics-maintainer, Thomas Hellstrom, David Airlie,
	dri-devel, kernel-janitors, linux-kernel

Good catch.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

On Thu, Oct 04, 2018 at 06:49:53PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The return statement is redundant as there is a return statement
> immediately before it so we have dead code that can be removed.
> Also remove the unused declaration of ret.
> 
> Detected by CoverityScan, CID#1473793 ("Structurally dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> index 5a6b70ba137a..260650bb5560 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> @@ -1738,7 +1738,6 @@ static int vmw_cmd_check_define_gmrfb(struct vmw_private *dev_priv,
>  				      void *buf)
>  {
>  	struct vmw_buffer_object *vmw_bo;
> -	int ret;
>  
>  	struct {
>  		uint32_t header;
> @@ -1748,7 +1747,6 @@ static int vmw_cmd_check_define_gmrfb(struct vmw_private *dev_priv,
>  	return vmw_translate_guest_ptr(dev_priv, sw_context,
>  				       &cmd->body.ptr,
>  				       &vmw_bo);
> -	return ret;
>  }
>  
>  
> -- 
> 2.17.1
> 

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

* Re: [PATCH][drm-next] drm/vmwgfx: remove redundant return ret statement
  2018-10-04 17:49 [PATCH][drm-next] drm/vmwgfx: remove redundant return ret statement Colin King
  2018-10-04 20:17 ` Sinclair Yeh
@ 2018-10-11  7:06 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-10-11  7:06 UTC (permalink / raw)
  To: Colin King
  Cc: VMware Graphics, Sinclair Yeh, Thomas Hellstrom, David Airlie,
	dri-devel, kernel-janitors, linux-kernel

On Thu, Oct 04, 2018 at 06:49:53PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The return statement is redundant as there is a return statement
> immediately before it so we have dead code that can be removed.
> Also remove the unused declaration of ret.
> 
> Detected by CoverityScan, CID#1473793 ("Structurally dead code")
> 

Introduced by commit b139d43dacef ("drm/vmwgfx: Make buffer object
lookups reference-free during validation").  The fix looks good.

regards,
dan carpenter


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

end of thread, other threads:[~2018-10-11  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 17:49 [PATCH][drm-next] drm/vmwgfx: remove redundant return ret statement Colin King
2018-10-04 20:17 ` Sinclair Yeh
2018-10-11  7:06 ` Dan Carpenter

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).