[PATCH 32/37] drm/amd/display/dc/link/protocols/link_dp_capability: Remove unused variable and mark another as __maybe_unused

Alex Deucher alexdeucher at gmail.com
Fri Mar 17 20:41:30 UTC 2023


Applied.  Thanks!

Alex

On Fri, Mar 17, 2023 at 4:23 AM Lee Jones <lee at kernel.org> wrote:
>
> ‘ds_port’ is clearly not used anywhere and ‘result_write_min_hblank’ is
> only utilised when debugging is enabled.  The alternative would be to
> allocate the variable under the same clause as the debugging code, but
> that would become very messy, very quickly.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_capability.c: In function ‘dp_wa_power_up_0010FA’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_capability.c:280:42: warning: variable ‘ds_port’ set but not used [-Wunused-but-set-variable]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_capability.c: In function ‘dpcd_set_source_specific_data’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_capability.c:1296:32: warning: variable ‘result_write_min_hblank’ set but not used [-Wunused-but-set-variable]
>
> Cc: Harry Wentland <harry.wentland at amd.com>
> Cc: Leo Li <sunpeng.li at amd.com>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: "Christian König" <christian.koenig at amd.com>
> Cc: "Pan, Xinhui" <Xinhui.Pan at amd.com>
> Cc: David Airlie <airlied at gmail.com>
> Cc: Daniel Vetter <daniel at ffwll.ch>
> Cc: Wenjing Liu <wenjing.liu at amd.com>
> Cc: amd-gfx at lists.freedesktop.org
> Cc: dri-devel at lists.freedesktop.org
> Signed-off-by: Lee Jones <lee at kernel.org>
> ---
>  .../gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c  | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
> index e9bcb35ae185a..51427f5081642 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
> @@ -1284,7 +1284,7 @@ bool dp_overwrite_extended_receiver_cap(struct dc_link *link)
>  void dpcd_set_source_specific_data(struct dc_link *link)
>  {
>         if (!link->dc->vendor_signature.is_valid) {
> -               enum dc_status result_write_min_hblank = DC_NOT_SUPPORTED;
> +               enum dc_status __maybe_unused result_write_min_hblank = DC_NOT_SUPPORTED;
>                 struct dpcd_amd_signature amd_signature = {0};
>                 struct dpcd_amd_device_id amd_device_id = {0};
>
> --
> 2.40.0.rc1.284.g88254d51c5-goog
>


More information about the amd-gfx mailing list