drm/amd/display: fix unused variable warning

Message ID 20210125124849.102037-1-arnd@kernel.org
State New
Headers show
Series
  • drm/amd/display: fix unused variable warning
Related show

Commit Message

Arnd Bergmann Jan. 25, 2021, 12:48 p.m.
From: Arnd Bergmann <arnd@arndb.de>


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 <arnd@arndb.de>

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.29.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Comments

Harry Wentland Jan. 25, 2021, 3:39 p.m. | #1
On 2021-01-25 7:48 a.m., Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>

> 

> 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 <arnd@arndb.de>


Reviewed-by: Harry Wentland <harry.wentland@amd.com>


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) {

> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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 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) {