2021-01-26 01:32:50

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] drm/amd/display: fix unused variable warning

From: Arnd Bergmann <[email protected]>

After all users of the 'dm' warnings got hidden in an #ifdef,
the compiler started warning about it being unused:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5380:33: error: unused variable 'dm' [-Werror,-Wunused-variable]

Add another such #ifdef.

Fixes: 98ab5f3513f9 ("drm/amd/display: Fix deadlock during gpu reset v3")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
1 file changed, 2 insertions(+)

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 a90dc4d31c32..37bf2dd87e1e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5377,7 +5377,9 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
struct amdgpu_device *adev = drm_to_adev(crtc->dev);
struct dm_crtc_state *acrtc_state = to_dm_crtc_state(crtc->state);
+#if defined(CONFIG_DRM_AMD_DC_DCN)
struct amdgpu_display_manager *dm = &adev->dm;
+#endif
int rc = 0;

if (enable) {
--
2.29.2


2021-01-26 17:41:52

by Harry Wentland

[permalink] [raw]
Subject: Re: [PATCH] drm/amd/display: fix unused variable warning

On 2021-01-25 7:48 a.m., Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> After all users of the 'dm' warnings got hidden in an #ifdef,
> the compiler started warning about it being unused:
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5380:33: error: unused variable 'dm' [-Werror,-Wunused-variable]
>
> Add another such #ifdef.
>
> Fixes: 98ab5f3513f9 ("drm/amd/display: Fix deadlock during gpu reset v3")
> Signed-off-by: Arnd Bergmann <[email protected]>

Reviewed-by: Harry Wentland <[email protected]>

Harry

> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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 a90dc4d31c32..37bf2dd87e1e 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5377,7 +5377,9 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
> struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
> struct amdgpu_device *adev = drm_to_adev(crtc->dev);
> struct dm_crtc_state *acrtc_state = to_dm_crtc_state(crtc->state);
> +#if defined(CONFIG_DRM_AMD_DC_DCN)
> struct amdgpu_display_manager *dm = &adev->dm;
> +#endif
> int rc = 0;
>
> if (enable) {
>