Message ID | 1572529284-88089-1-git-send-email-zhengbin13@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/vmwgfx: remove set but not used variable 'srf' | expand |
ping On 2019/10/31 21:41, zhengbin wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/gpu/drm/vmwgfx/vmwgfx_surface.c: In function vmw_hw_surface_destroy: > drivers/gpu/drm/vmwgfx/vmwgfx_surface.c:335:22: warning: variable srf set but not used [-Wunused-but-set-variable] > > It is introduced by commit 543831cfc976 ("drm/vmwgfx: > Break out surface and context management to separate files"), > but never used, so remove it. > > Reported-by: Hulk Robot <hulkci@huawei.com> > Signed-off-by: zhengbin <zhengbin13@huawei.com> > --- > drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c > index 29d8794..de0530b 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c > @@ -336,7 +336,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res) > { > > struct vmw_private *dev_priv = res->dev_priv; > - struct vmw_surface *srf; > void *cmd; > > if (res->func->destroy == vmw_gb_surface_destroy) { > @@ -360,7 +359,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res) > */ > > mutex_lock(&dev_priv->cmdbuf_mutex); > - srf = vmw_res_to_srf(res); > dev_priv->used_memory_size -= res->backup_size; > mutex_unlock(&dev_priv->cmdbuf_mutex); > } > -- > 2.7.4 > > > . >
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index 29d8794..de0530b 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -336,7 +336,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res) { struct vmw_private *dev_priv = res->dev_priv; - struct vmw_surface *srf; void *cmd; if (res->func->destroy == vmw_gb_surface_destroy) { @@ -360,7 +359,6 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res) */ mutex_lock(&dev_priv->cmdbuf_mutex); - srf = vmw_res_to_srf(res); dev_priv->used_memory_size -= res->backup_size; mutex_unlock(&dev_priv->cmdbuf_mutex); }
Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/vmwgfx/vmwgfx_surface.c: In function vmw_hw_surface_destroy: drivers/gpu/drm/vmwgfx/vmwgfx_surface.c:335:22: warning: variable srf set but not used [-Wunused-but-set-variable] It is introduced by commit 543831cfc976 ("drm/vmwgfx: Break out surface and context management to separate files"), but never used, so remove it. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 2 -- 1 file changed, 2 deletions(-) -- 2.7.4