diff mbox series

[21/40] drm/amd/display/dc/calcs/dce_calcs: Remove unused variables 'v_filter_init_mode' and 'sclk_lvl'

Message ID 20210108201457.3078600-22-lee.jones@linaro.org
State Accepted
Commit 737b702a3014ec6a0aaed0aa7d3c769f0883d698
Headers show
Series Rid W=1 warnings from GPU | expand

Commit Message

Lee Jones Jan. 8, 2021, 8:14 p.m. UTC
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘calculate_bandwidth’:
 drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:109:18: warning: variable ‘v_filter_init_mode’ set but not used [-Wunused-but-set-variable]
 drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘bw_calcs’:
 drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:3031:21: warning: variable ‘sclk_lvl’ set but not used [-Wunused-but-set-variable]

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Alex Deucher Jan. 8, 2021, 9:07 p.m. UTC | #1
On Fri, Jan 8, 2021 at 3:15 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘calculate_bandwidth’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:109:18: warning: variable ‘v_filter_init_mode’ set but not used [-Wunused-but-set-variable]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘bw_calcs’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:3031:21: warning: variable ‘sclk_lvl’ set but not used [-Wunused-but-set-variable]
>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Leo Li <sunpeng.li@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

@Harry Wentland
, @Leo (Sunpeng) Li I think this file is generated from a script or
something.  Wanted to get your take on how to properly integrate a
change like this.

Alex


> ---
>  drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> index ef41b287cbe23..158d927c03e55 100644
> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> @@ -106,7 +106,6 @@ static void calculate_bandwidth(
>         bool lpt_enabled;
>         enum bw_defines sclk_message;
>         enum bw_defines yclk_message;
> -       enum bw_defines v_filter_init_mode[maximum_number_of_surfaces];
>         enum bw_defines tiling_mode[maximum_number_of_surfaces];
>         enum bw_defines surface_type[maximum_number_of_surfaces];
>         enum bw_defines voltage;
> @@ -792,12 +791,8 @@ static void calculate_bandwidth(
>                                 data->v_filter_init[i] = bw_add(data->v_filter_init[i], bw_int_to_fixed(1));
>                         }
>                         if (data->stereo_mode[i] == bw_def_top_bottom) {
> -                               v_filter_init_mode[i] = bw_def_manual;
>                                 data->v_filter_init[i] = bw_min2(data->v_filter_init[i], bw_int_to_fixed(4));
>                         }
> -                       else {
> -                               v_filter_init_mode[i] = bw_def_auto;
> -                       }
>                         if (data->stereo_mode[i] == bw_def_top_bottom) {
>                                 data->num_lines_at_frame_start = bw_int_to_fixed(1);
>                         }
> @@ -3028,7 +3023,7 @@ bool bw_calcs(struct dc_context *ctx,
>                 calcs_output->all_displays_in_sync = false;
>
>         if (data->number_of_displays != 0) {
> -               uint8_t yclk_lvl, sclk_lvl;
> +               uint8_t yclk_lvl;
>                 struct bw_fixed high_sclk = vbios->high_sclk;
>                 struct bw_fixed mid1_sclk = vbios->mid1_sclk;
>                 struct bw_fixed mid2_sclk = vbios->mid2_sclk;
> @@ -3049,7 +3044,6 @@ bool bw_calcs(struct dc_context *ctx,
>                 calculate_bandwidth(dceip, vbios, data);
>
>                 yclk_lvl = data->y_clk_level;
> -               sclk_lvl = data->sclk_level;
>
>                 calcs_output->nbp_state_change_enable =
>                         data->nbp_state_change_enable;
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher Jan. 14, 2021, 4:50 p.m. UTC | #2
Applied.  Thanks!

Alex

On Fri, Jan 8, 2021 at 3:15 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘calculate_bandwidth’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:109:18: warning: variable ‘v_filter_init_mode’ set but not used [-Wunused-but-set-variable]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘bw_calcs’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:3031:21: warning: variable ‘sclk_lvl’ set but not used [-Wunused-but-set-variable]
>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Leo Li <sunpeng.li@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> index ef41b287cbe23..158d927c03e55 100644
> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> @@ -106,7 +106,6 @@ static void calculate_bandwidth(
>         bool lpt_enabled;
>         enum bw_defines sclk_message;
>         enum bw_defines yclk_message;
> -       enum bw_defines v_filter_init_mode[maximum_number_of_surfaces];
>         enum bw_defines tiling_mode[maximum_number_of_surfaces];
>         enum bw_defines surface_type[maximum_number_of_surfaces];
>         enum bw_defines voltage;
> @@ -792,12 +791,8 @@ static void calculate_bandwidth(
>                                 data->v_filter_init[i] = bw_add(data->v_filter_init[i], bw_int_to_fixed(1));
>                         }
>                         if (data->stereo_mode[i] == bw_def_top_bottom) {
> -                               v_filter_init_mode[i] = bw_def_manual;
>                                 data->v_filter_init[i] = bw_min2(data->v_filter_init[i], bw_int_to_fixed(4));
>                         }
> -                       else {
> -                               v_filter_init_mode[i] = bw_def_auto;
> -                       }
>                         if (data->stereo_mode[i] == bw_def_top_bottom) {
>                                 data->num_lines_at_frame_start = bw_int_to_fixed(1);
>                         }
> @@ -3028,7 +3023,7 @@ bool bw_calcs(struct dc_context *ctx,
>                 calcs_output->all_displays_in_sync = false;
>
>         if (data->number_of_displays != 0) {
> -               uint8_t yclk_lvl, sclk_lvl;
> +               uint8_t yclk_lvl;
>                 struct bw_fixed high_sclk = vbios->high_sclk;
>                 struct bw_fixed mid1_sclk = vbios->mid1_sclk;
>                 struct bw_fixed mid2_sclk = vbios->mid2_sclk;
> @@ -3049,7 +3044,6 @@ bool bw_calcs(struct dc_context *ctx,
>                 calculate_bandwidth(dceip, vbios, data);
>
>                 yclk_lvl = data->y_clk_level;
> -               sclk_lvl = data->sclk_level;
>
>                 calcs_output->nbp_state_change_enable =
>                         data->nbp_state_change_enable;
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
index ef41b287cbe23..158d927c03e55 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
@@ -106,7 +106,6 @@  static void calculate_bandwidth(
 	bool lpt_enabled;
 	enum bw_defines sclk_message;
 	enum bw_defines yclk_message;
-	enum bw_defines v_filter_init_mode[maximum_number_of_surfaces];
 	enum bw_defines tiling_mode[maximum_number_of_surfaces];
 	enum bw_defines surface_type[maximum_number_of_surfaces];
 	enum bw_defines voltage;
@@ -792,12 +791,8 @@  static void calculate_bandwidth(
 				data->v_filter_init[i] = bw_add(data->v_filter_init[i], bw_int_to_fixed(1));
 			}
 			if (data->stereo_mode[i] == bw_def_top_bottom) {
-				v_filter_init_mode[i] = bw_def_manual;
 				data->v_filter_init[i] = bw_min2(data->v_filter_init[i], bw_int_to_fixed(4));
 			}
-			else {
-				v_filter_init_mode[i] = bw_def_auto;
-			}
 			if (data->stereo_mode[i] == bw_def_top_bottom) {
 				data->num_lines_at_frame_start = bw_int_to_fixed(1);
 			}
@@ -3028,7 +3023,7 @@  bool bw_calcs(struct dc_context *ctx,
 		calcs_output->all_displays_in_sync = false;
 
 	if (data->number_of_displays != 0) {
-		uint8_t yclk_lvl, sclk_lvl;
+		uint8_t yclk_lvl;
 		struct bw_fixed high_sclk = vbios->high_sclk;
 		struct bw_fixed mid1_sclk = vbios->mid1_sclk;
 		struct bw_fixed mid2_sclk = vbios->mid2_sclk;
@@ -3049,7 +3044,6 @@  bool bw_calcs(struct dc_context *ctx,
 		calculate_bandwidth(dceip, vbios, data);
 
 		yclk_lvl = data->y_clk_level;
-		sclk_lvl = data->sclk_level;
 
 		calcs_output->nbp_state_change_enable =
 			data->nbp_state_change_enable;