2022-02-10 16:34:34

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 1/3] drm/msm/dpu: Remove set but unused variables

We get warning:

In function ‘dpu_encoder_virt_enable’: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1145:33:
warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
1145 | struct msm_drm_private *priv;

In function ‘dpu_encoder_virt_disable’: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1182:33:
warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
1182 | struct msm_drm_private *priv;

Remove these unused but set variables

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 1e648db439f9..132844801e92 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -1142,14 +1142,12 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
{
struct dpu_encoder_virt *dpu_enc = NULL;
int ret = 0;
- struct msm_drm_private *priv;
struct drm_display_mode *cur_mode = NULL;

dpu_enc = to_dpu_encoder_virt(drm_enc);

mutex_lock(&dpu_enc->enc_lock);
cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;
- priv = drm_enc->dev->dev_private;

trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay,
cur_mode->vdisplay);
@@ -1179,7 +1177,6 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
{
struct dpu_encoder_virt *dpu_enc = NULL;
- struct msm_drm_private *priv;
int i = 0;

dpu_enc = to_dpu_encoder_virt(drm_enc);
@@ -1188,8 +1185,6 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
mutex_lock(&dpu_enc->enc_lock);
dpu_enc->enabled = false;

- priv = drm_enc->dev->dev_private;
-
trace_dpu_enc_disable(DRMID(drm_enc));

/* wait for idle */
--
2.31.1



2022-02-11 06:10:11

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH 1/3] drm/msm/dpu: Remove set but unused variables

On 10/02/2022 14:41, Vinod Koul wrote:
> We get warning:
>
> In function ‘dpu_encoder_virt_enable’: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1145:33:
> warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
> 1145 | struct msm_drm_private *priv;
>
> In function ‘dpu_encoder_virt_disable’: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1182:33:
> warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
> 1182 | struct msm_drm_private *priv;
>
> Remove these unused but set variables
>
> Signed-off-by: Vinod Koul <[email protected]>

Reviewed-by: Dmitry Baryshkov <[email protected]>

> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 1e648db439f9..132844801e92 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -1142,14 +1142,12 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
> {
> struct dpu_encoder_virt *dpu_enc = NULL;
> int ret = 0;
> - struct msm_drm_private *priv;
> struct drm_display_mode *cur_mode = NULL;
>
> dpu_enc = to_dpu_encoder_virt(drm_enc);
>
> mutex_lock(&dpu_enc->enc_lock);
> cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;
> - priv = drm_enc->dev->dev_private;
>
> trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay,
> cur_mode->vdisplay);
> @@ -1179,7 +1177,6 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
> static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
> {
> struct dpu_encoder_virt *dpu_enc = NULL;
> - struct msm_drm_private *priv;
> int i = 0;
>
> dpu_enc = to_dpu_encoder_virt(drm_enc);
> @@ -1188,8 +1185,6 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
> mutex_lock(&dpu_enc->enc_lock);
> dpu_enc->enabled = false;
>
> - priv = drm_enc->dev->dev_private;
> -
> trace_dpu_enc_disable(DRMID(drm_enc));
>
> /* wait for idle */


--
With best wishes
Dmitry

2022-02-11 08:53:42

by Abhinav Kumar

[permalink] [raw]
Subject: Re: [Freedreno] [PATCH 1/3] drm/msm/dpu: Remove set but unused variables



On 2/10/2022 3:41 AM, Vinod Koul wrote:
> We get warning:
>
> In function ‘dpu_encoder_virt_enable’: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1145:33:
> warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
> 1145 | struct msm_drm_private *priv;
>
> In function ‘dpu_encoder_virt_disable’: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1182:33:
> warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
> 1182 | struct msm_drm_private *priv;
>
> Remove these unused but set variables
>
> Signed-off-by: Vinod Koul <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 1e648db439f9..132844801e92 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -1142,14 +1142,12 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
> {
> struct dpu_encoder_virt *dpu_enc = NULL;
> int ret = 0;
> - struct msm_drm_private *priv;
> struct drm_display_mode *cur_mode = NULL;
>
> dpu_enc = to_dpu_encoder_virt(drm_enc);
>
> mutex_lock(&dpu_enc->enc_lock);
> cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;
> - priv = drm_enc->dev->dev_private;
>
> trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay,
> cur_mode->vdisplay);
> @@ -1179,7 +1177,6 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
> static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
> {
> struct dpu_encoder_virt *dpu_enc = NULL;
> - struct msm_drm_private *priv;
> int i = 0;
>
> dpu_enc = to_dpu_encoder_virt(drm_enc);
> @@ -1188,8 +1185,6 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
> mutex_lock(&dpu_enc->enc_lock);
> dpu_enc->enabled = false;
>
> - priv = drm_enc->dev->dev_private;
> -
> trace_dpu_enc_disable(DRMID(drm_enc));
>
> /* wait for idle */