diff mbox series

[-next] drm/vmwgfx: Remove set but not used variable 'fb_offset, fb_depth'

Message ID 20190323024606.163683-1-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] drm/vmwgfx: Remove set but not used variable 'fb_offset, fb_depth' | expand

Commit Message

Yue Haibing March 23, 2019, 2:46 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:29: warning:
 variable 'fb_offset' set but not used [-Wunused-but-set-variable]

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:19: warning:
 variable 'fb_depth' set but not used [-Wunused-but-set-variable]

They're not used any more, so can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Deepak Singh Rawat March 25, 2019, 5:26 p.m. UTC | #1
Thanks for doing this.

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

On Sat, 2019-03-23 at 02:46 +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:29: warning:
>  variable 'fb_offset' set but not used [-Wunused-but-set-variable]
> 
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:19: warning:
>  variable 'fb_depth' set but not used [-Wunused-but-set-variable]
> 
> They're not used any more, so can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> index 2a9112515f46..86efb91f5034 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> @@ -642,12 +642,11 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
>  	struct vmw_fb_par *par;
>  	struct fb_info *info;
>  	unsigned fb_width, fb_height;
> -	unsigned fb_bpp, fb_depth, fb_offset, fb_pitch, fb_size;
> +	unsigned fb_bpp, fb_pitch, fb_size;
>  	struct drm_display_mode *init_mode;
>  	int ret;
>  
>  	fb_bpp = 32;
> -	fb_depth = 24;
>  
>  	/* XXX As shouldn't these be as well. */
>  	fb_width = min(vmw_priv->fb_max_width, (unsigned)2048);
> @@ -655,7 +654,6 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
>  
>  	fb_pitch = fb_width * fb_bpp / 8;
>  	fb_size = fb_pitch * fb_height;
> -	fb_offset = vmw_read(vmw_priv, SVGA_REG_FB_OFFSET);
>  
>  	info = framebuffer_alloc(sizeof(*par), device);
>  	if (!info)
> 
> 
>
Mukesh Ojha March 26, 2019, 6:54 a.m. UTC | #2
On 3/23/2019 8:16 AM, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:29: warning:
>   variable 'fb_offset' set but not used [-Wunused-but-set-variable]
>
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:19: warning:
>   variable 'fb_depth' set but not used [-Wunused-but-set-variable]
>
> They're not used any more, so can be removed.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Mukesh Ojha <mojha@codeaurora.org 
<mailto:mojha@codeaurora.org>>

Thanks.
Mukesh


> ---
>   drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> index 2a9112515f46..86efb91f5034 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> @@ -642,12 +642,11 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
>   	struct vmw_fb_par *par;
>   	struct fb_info *info;
>   	unsigned fb_width, fb_height;
> -	unsigned fb_bpp, fb_depth, fb_offset, fb_pitch, fb_size;
> +	unsigned fb_bpp, fb_pitch, fb_size;
>   	struct drm_display_mode *init_mode;
>   	int ret;
>   
>   	fb_bpp = 32;
> -	fb_depth = 24;
>   
>   	/* XXX As shouldn't these be as well. */
>   	fb_width = min(vmw_priv->fb_max_width, (unsigned)2048);
> @@ -655,7 +654,6 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
>   
>   	fb_pitch = fb_width * fb_bpp / 8;
>   	fb_size = fb_pitch * fb_height;
> -	fb_offset = vmw_read(vmw_priv, SVGA_REG_FB_OFFSET);
>   
>   	info = framebuffer_alloc(sizeof(*par), device);
>   	if (!info)
>
>
>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 3/23/2019 8:16 AM, YueHaibing wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20190323024606.163683-1-yuehaibing@huawei.com">
      <pre class="moz-quote-pre" wrap="">Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:29: warning:
 variable 'fb_offset' set but not used [-Wunused-but-set-variable]

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:19: warning:
 variable 'fb_depth' set but not used [-Wunused-but-set-variable]

They're not used any more, so can be removed.

Signed-off-by: YueHaibing <a class="moz-txt-link-rfc2396E" href="mailto:yuehaibing@huawei.com">&lt;yuehaibing@huawei.com&gt;</a></pre>
    </blockquote>
    <p>
      Reviewed-by: Mukesh Ojha &lt;<a href="mailto:mojha@codeaurora.org"
        title="mojha@codeaurora.org" class="mailto">mojha@codeaurora.org</a>&gt;
    </p>
    <p>
      Thanks.<br>
      Mukesh
    </p>
    <p><br>
    </p>
    <blockquote type="cite"
      cite="mid:20190323024606.163683-1-yuehaibing@huawei.com">
      <pre class="moz-quote-pre" wrap="">
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index 2a9112515f46..86efb91f5034 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -642,12 +642,11 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
 	struct vmw_fb_par *par;
 	struct fb_info *info;
 	unsigned fb_width, fb_height;
-	unsigned fb_bpp, fb_depth, fb_offset, fb_pitch, fb_size;
+	unsigned fb_bpp, fb_pitch, fb_size;
 	struct drm_display_mode *init_mode;
 	int ret;
 
 	fb_bpp = 32;
-	fb_depth = 24;
 
 	/* XXX As shouldn't these be as well. */
 	fb_width = min(vmw_priv-&gt;fb_max_width, (unsigned)2048);
@@ -655,7 +654,6 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
 
 	fb_pitch = fb_width * fb_bpp / 8;
 	fb_size = fb_pitch * fb_height;
-	fb_offset = vmw_read(vmw_priv, SVGA_REG_FB_OFFSET);
 
 	info = framebuffer_alloc(sizeof(*par), device);
 	if (!info)



</pre>
    </blockquote>
  </body>
</html>
Mukesh Ojha March 27, 2019, 1:59 p.m. UTC | #3
On 3/23/2019 8:16 AM, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:29: warning:
>   variable 'fb_offset' set but not used [-Wunused-but-set-variable]
>
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:645:19: warning:
>   variable 'fb_depth' set but not used [-Wunused-but-set-variable]
>
> They're not used any more, so can be removed.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>


Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

-Mukesh

> ---
>   drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> index 2a9112515f46..86efb91f5034 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> @@ -642,12 +642,11 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
>   	struct vmw_fb_par *par;
>   	struct fb_info *info;
>   	unsigned fb_width, fb_height;
> -	unsigned fb_bpp, fb_depth, fb_offset, fb_pitch, fb_size;
> +	unsigned fb_bpp, fb_pitch, fb_size;
>   	struct drm_display_mode *init_mode;
>   	int ret;
>   
>   	fb_bpp = 32;
> -	fb_depth = 24;
>   
>   	/* XXX As shouldn't these be as well. */
>   	fb_width = min(vmw_priv->fb_max_width, (unsigned)2048);
> @@ -655,7 +654,6 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
>   
>   	fb_pitch = fb_width * fb_bpp / 8;
>   	fb_size = fb_pitch * fb_height;
> -	fb_offset = vmw_read(vmw_priv, SVGA_REG_FB_OFFSET);
>   
>   	info = framebuffer_alloc(sizeof(*par), device);
>   	if (!info)
>
>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index 2a9112515f46..86efb91f5034 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -642,12 +642,11 @@  int vmw_fb_init(struct vmw_private *vmw_priv)
 	struct vmw_fb_par *par;
 	struct fb_info *info;
 	unsigned fb_width, fb_height;
-	unsigned fb_bpp, fb_depth, fb_offset, fb_pitch, fb_size;
+	unsigned fb_bpp, fb_pitch, fb_size;
 	struct drm_display_mode *init_mode;
 	int ret;
 
 	fb_bpp = 32;
-	fb_depth = 24;
 
 	/* XXX As shouldn't these be as well. */
 	fb_width = min(vmw_priv->fb_max_width, (unsigned)2048);
@@ -655,7 +654,6 @@  int vmw_fb_init(struct vmw_private *vmw_priv)
 
 	fb_pitch = fb_width * fb_bpp / 8;
 	fb_size = fb_pitch * fb_height;
-	fb_offset = vmw_read(vmw_priv, SVGA_REG_FB_OFFSET);
 
 	info = framebuffer_alloc(sizeof(*par), device);
 	if (!info)