[next] drm/vmwgfx: remove redundant assignment to sub_res

Submitted by Colin King on June 24, 2019, 10:44 p.m.

Details

Message ID 20190624224444.14099-1-colin.king@canonical.com
State New
Headers show
Series "drm/vmwgfx: remove redundant assignment to sub_res" ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Colin King June 24, 2019, 10:44 p.m.
From: Colin Ian King <colin.king@canonical.com>

Variable sub_res is initialized to a value that is never read and it
is re-assigned later in a for-loop.  The initialization is redundant
and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index 862ca44680ca..3257ba689d93 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -1914,7 +1914,7 @@  static void vmw_surface_tex_dirty_range_add(struct vmw_resource *res,
 	} else {
 		/* Dirty range covers multiple sub-resources */
 		struct svga3dsurface_loc loc_min, loc_max;
-		u32 sub_res = loc1.sub_resource;
+		u32 sub_res;
 
 		svga3dsurface_max_loc(cache, loc1.sub_resource, &loc_max);
 		vmw_subres_dirty_add(dirty, &loc1, &loc_max);

Comments

Hi Colin,

Reviewed-by: Deepak Rawat <drawat@vmware.com>


Thanks,
Deepak


On Mon, 2019-06-24 at 23:44 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>

> 

> Variable sub_res is initialized to a value that is never read and it

> is re-assigned later in a for-loop.  The initialization is redundant

> and can be removed.

> 

> Addresses-Coverity: ("Unused value")

> Signed-off-by: Colin Ian King <colin.king@canonical.com>

> ---

>  drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

> b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

> index 862ca44680ca..3257ba689d93 100644

> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

> @@ -1914,7 +1914,7 @@ static void

> vmw_surface_tex_dirty_range_add(struct vmw_resource *res,

>  	} else {

>  		/* Dirty range covers multiple sub-resources */

>  		struct svga3dsurface_loc loc_min, loc_max;

> -		u32 sub_res = loc1.sub_resource;

> +		u32 sub_res;

>  

>  		svga3dsurface_max_loc(cache, loc1.sub_resource,

> &loc_max);

>  		vmw_subres_dirty_add(dirty, &loc1, &loc_max);