diff mbox series

[04/53] drm/amd/display/dc/bios/command_table: Remove unused variable

Message ID 20210303134319.3160762-5-lee.jones@linaro.org (mailing list archive)
State New, archived
Headers show
Series Rid GPU from W=1 warnings | expand

Commit Message

Lee Jones March 3, 2021, 1:42 p.m. UTC
None of the surrounding code was removed just in case even a small
fraction of it was functional.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/../display/dc/bios/command_table.c: In function ‘adjust_display_pll_v2’:
 drivers/gpu/drm/amd/amdgpu/../display/dc/bios/command_table.c:1459:35: warning: variable ‘params’ 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: Qinglang Miao <miaoqinglang@huawei.com>
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/bios/command_table.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Comments

Alex Deucher March 3, 2021, 3:22 p.m. UTC | #1
On Wed, Mar 3, 2021 at 8:43 AM Lee Jones <lee.jones@linaro.org> wrote:
>
> None of the surrounding code was removed just in case even a small
> fraction of it was functional.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/bios/command_table.c: In function ‘adjust_display_pll_v2’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/bios/command_table.c:1459:35: warning: variable ‘params’ 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: Qinglang Miao <miaoqinglang@huawei.com>
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

This function should be calling the atom cmd table with the
parameters.  Just sent a patch to fix this:
https://patchwork.freedesktop.org/patch/422833/

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/bios/command_table.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table.c b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
> index afc10b954ffa7..9d3bc3a073821 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c
> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
> @@ -1517,20 +1517,14 @@ static enum bp_result adjust_display_pll_v2(
>         struct bp_adjust_pixel_clock_parameters *bp_params)
>  {
>         enum bp_result result = BP_RESULT_FAILURE;
> -       ADJUST_DISPLAY_PLL_PS_ALLOCATION params = { 0 };
>
>         /* We need to convert from KHz units into 10KHz units and then convert
>          * output pixel clock back 10KHz-->KHz */
>         uint32_t pixel_clock_10KHz_in = bp_params->pixel_clock / 10;
>
> -       params.usPixelClock = cpu_to_le16((uint16_t)(pixel_clock_10KHz_in));
> -       params.ucTransmitterID =
> -                       bp->cmd_helper->encoder_id_to_atom(
> -                                       dal_graphics_object_id_get_encoder_id(
> -                                                       bp_params->encoder_object_id));
> -       params.ucEncodeMode =
> -                       (uint8_t)bp->cmd_helper->encoder_mode_bp_to_atom(
> -                                       bp_params->signal_type, false);
> +       bp->cmd_helper->encoder_id_to_atom(
> +               dal_graphics_object_id_get_encoder_id(bp_params->encoder_object_id));
> +       bp->cmd_helper->encoder_mode_bp_to_atom(bp_params->signal_type, false);
>         return result;
>  }
>
> --
> 2.27.0
>
> _______________________________________________
> 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/bios/command_table.c b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
index afc10b954ffa7..9d3bc3a073821 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
@@ -1517,20 +1517,14 @@  static enum bp_result adjust_display_pll_v2(
 	struct bp_adjust_pixel_clock_parameters *bp_params)
 {
 	enum bp_result result = BP_RESULT_FAILURE;
-	ADJUST_DISPLAY_PLL_PS_ALLOCATION params = { 0 };
 
 	/* We need to convert from KHz units into 10KHz units and then convert
 	 * output pixel clock back 10KHz-->KHz */
 	uint32_t pixel_clock_10KHz_in = bp_params->pixel_clock / 10;
 
-	params.usPixelClock = cpu_to_le16((uint16_t)(pixel_clock_10KHz_in));
-	params.ucTransmitterID =
-			bp->cmd_helper->encoder_id_to_atom(
-					dal_graphics_object_id_get_encoder_id(
-							bp_params->encoder_object_id));
-	params.ucEncodeMode =
-			(uint8_t)bp->cmd_helper->encoder_mode_bp_to_atom(
-					bp_params->signal_type, false);
+	bp->cmd_helper->encoder_id_to_atom(
+		dal_graphics_object_id_get_encoder_id(bp_params->encoder_object_id));
+	bp->cmd_helper->encoder_mode_bp_to_atom(bp_params->signal_type, false);
 	return result;
 }