drm/amd/display: remove unused matching_stream_ptrs variable

Message ID 20230325134503.1335510-1-trix@redhat.com
State New
Headers
Series drm/amd/display: remove unused matching_stream_ptrs variable |

Commit Message

Tom Rix March 25, 2023, 1:45 p.m. UTC
  clang with W=1 reports
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_enc_cfg.c:625:6: error:
  variable 'matching_stream_ptrs' set but not used [-Werror,-Wunused-but-set-variable]
        int matching_stream_ptrs = 0;
            ^
This variable is not used so remove it.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Comments

Nick Desaulniers April 7, 2023, 5:52 p.m. UTC | #1
Jimmy, can you review?

The change LGTM; but I'm not sure if there was something else intended here.

On Sat, Mar 25, 2023 at 6:45 AM Tom Rix <trix@redhat.com> wrote:
>
> clang with W=1 reports
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_enc_cfg.c:625:6: error:
>   variable 'matching_stream_ptrs' set but not used [-Werror,-Wunused-but-set-variable]
>         int matching_stream_ptrs = 0;
>             ^
> This variable is not used so remove it.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> index 41198c729d90..30c0644d4418 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> @@ -622,7 +622,6 @@ bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)
>         int i, j;
>         uint8_t valid_count = 0;
>         uint8_t dig_stream_count = 0;
> -       int matching_stream_ptrs = 0;
>         int eng_ids_per_ep_id[MAX_PIPES] = {0};
>         int ep_ids_per_eng_id[MAX_PIPES] = {0};
>         int valid_bitmap = 0;
> @@ -645,9 +644,7 @@ bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)
>                 struct link_enc_assignment assignment = state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i];
>
>                 if (assignment.valid) {
> -                       if (assignment.stream == state->streams[i])
> -                               matching_stream_ptrs++;
> -                       else
> +                       if (assignment.stream != state->streams[i])
>                                 valid_stream_ptrs = false;
>                 }
>         }
> --
> 2.27.0
>
  
Nick Desaulniers April 7, 2023, 6:29 p.m. UTC | #2
On Fri, Apr 7, 2023 at 10:52 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> Jimmy, can you review?
>
> The change LGTM; but I'm not sure if there was something else intended here.

Nevermind, Jimmy's email address bounced.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

>
> On Sat, Mar 25, 2023 at 6:45 AM Tom Rix <trix@redhat.com> wrote:
> >
> > clang with W=1 reports
> > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_enc_cfg.c:625:6: error:
> >   variable 'matching_stream_ptrs' set but not used [-Werror,-Wunused-but-set-variable]
> >         int matching_stream_ptrs = 0;
> >             ^
> > This variable is not used so remove it.
> >
> > Signed-off-by: Tom Rix <trix@redhat.com>
> > ---
> >  drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> > index 41198c729d90..30c0644d4418 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> > @@ -622,7 +622,6 @@ bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)
> >         int i, j;
> >         uint8_t valid_count = 0;
> >         uint8_t dig_stream_count = 0;
> > -       int matching_stream_ptrs = 0;
> >         int eng_ids_per_ep_id[MAX_PIPES] = {0};
> >         int ep_ids_per_eng_id[MAX_PIPES] = {0};
> >         int valid_bitmap = 0;
> > @@ -645,9 +644,7 @@ bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)
> >                 struct link_enc_assignment assignment = state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i];
> >
> >                 if (assignment.valid) {
> > -                       if (assignment.stream == state->streams[i])
> > -                               matching_stream_ptrs++;
> > -                       else
> > +                       if (assignment.stream != state->streams[i])
> >                                 valid_stream_ptrs = false;
> >                 }
> >         }
> > --
> > 2.27.0
> >
>
>
> --
> Thanks,
> ~Nick Desaulniers
  
Hamza Mahfooz April 10, 2023, 2:47 p.m. UTC | #3
On 3/25/23 09:45, Tom Rix wrote:
> clang with W=1 reports
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_enc_cfg.c:625:6: error:
>    variable 'matching_stream_ptrs' set but not used [-Werror,-Wunused-but-set-variable]
>          int matching_stream_ptrs = 0;
>              ^
> This variable is not used so remove it.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Applied, thanks!

> ---
>   drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> index 41198c729d90..30c0644d4418 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> @@ -622,7 +622,6 @@ bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)
>   	int i, j;
>   	uint8_t valid_count = 0;
>   	uint8_t dig_stream_count = 0;
> -	int matching_stream_ptrs = 0;
>   	int eng_ids_per_ep_id[MAX_PIPES] = {0};
>   	int ep_ids_per_eng_id[MAX_PIPES] = {0};
>   	int valid_bitmap = 0;
> @@ -645,9 +644,7 @@ bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)
>   		struct link_enc_assignment assignment = state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i];
>   
>   		if (assignment.valid) {
> -			if (assignment.stream == state->streams[i])
> -				matching_stream_ptrs++;
> -			else
> +			if (assignment.stream != state->streams[i])
>   				valid_stream_ptrs = false;
>   		}
>   	}
  

Patch

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
index 41198c729d90..30c0644d4418 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
@@ -622,7 +622,6 @@  bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)
 	int i, j;
 	uint8_t valid_count = 0;
 	uint8_t dig_stream_count = 0;
-	int matching_stream_ptrs = 0;
 	int eng_ids_per_ep_id[MAX_PIPES] = {0};
 	int ep_ids_per_eng_id[MAX_PIPES] = {0};
 	int valid_bitmap = 0;
@@ -645,9 +644,7 @@  bool link_enc_cfg_validate(struct dc *dc, struct dc_state *state)
 		struct link_enc_assignment assignment = state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i];
 
 		if (assignment.valid) {
-			if (assignment.stream == state->streams[i])
-				matching_stream_ptrs++;
-			else
+			if (assignment.stream != state->streams[i])
 				valid_stream_ptrs = false;
 		}
 	}