diff mbox series

[32/40] drm/amd/display/amdgpu_dm/amdgpu_dm: Mark 'link_bandwidth_kbps' as __maybe_unused

Message ID 20201126134240.3214176-33-lee.jones@linaro.org
State New
Headers show
Series [01/40] drm/amd/pm/powerplay/smumgr/tonga_smumgr: Remove set but unused variable 'res' | expand

Commit Message

Lee Jones Nov. 26, 2020, 1:42 p.m. UTC
'link_bandwidth_kbps' is always obtained, but only used if
CONFIG_DRM_AMD_DC_DCN is defined.

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

 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function ‘create_stream_for_sink’:
 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5080:11: warning: variable ‘link_bandwidth_kbps’ 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/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Deucher Nov. 30, 2020, 11:57 p.m. UTC | #1
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones <lee.jones@linaro.org> wrote:
>
> 'link_bandwidth_kbps' is always obtained, but only used if
> CONFIG_DRM_AMD_DC_DCN is defined.

Probably better to just move this under CONFIG_DRM_AMD_DC_DCN.  I'll
send a patch.

Thanks,

Alex


>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function ‘create_stream_for_sink’:
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5080:11: warning: variable ‘link_bandwidth_kbps’ 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/amdgpu_dm/amdgpu_dm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 08539f4315864..ac7643d73bc68 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5077,7 +5077,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
>  #if defined(CONFIG_DRM_AMD_DC_DCN)
>         struct dsc_dec_dpcd_caps dsc_caps;
>  #endif
> -       uint32_t link_bandwidth_kbps;
> +       uint32_t __maybe_unused link_bandwidth_kbps;
>
>         struct dc_sink *sink = NULL;
>         if (aconnector == NULL) {
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Lee Jones Dec. 1, 2020, 7:19 a.m. UTC | #2
On Mon, 30 Nov 2020, Alex Deucher wrote:

> On Thu, Nov 26, 2020 at 8:43 AM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > 'link_bandwidth_kbps' is always obtained, but only used if
> > CONFIG_DRM_AMD_DC_DCN is defined.
> 
> Probably better to just move this under CONFIG_DRM_AMD_DC_DCN.  I'll
> send a patch.

I considered that, but thought there would have been good reason for
the clause break just for dc_link_bandwidth_kbps().
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 08539f4315864..ac7643d73bc68 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5077,7 +5077,7 @@  create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
 #if defined(CONFIG_DRM_AMD_DC_DCN)
 	struct dsc_dec_dpcd_caps dsc_caps;
 #endif
-	uint32_t link_bandwidth_kbps;
+	uint32_t __maybe_unused link_bandwidth_kbps;
 
 	struct dc_sink *sink = NULL;
 	if (aconnector == NULL) {