[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Dennis Li <dennis...@amd.com>

-----Original Message-----
From: Chen, Guchun <guchun.c...@amd.com> 
Sent: Thursday, August 13, 2020 3:04 PM
To: amd-gfx@lists.freedesktop.org; Zhang, Hawking <hawking.zh...@amd.com>; Li, 
Dennis <dennis...@amd.com>; Zhou1, Tao <tao.zh...@amd.com>; Clements, John 
<john.cleme...@amd.com>; Deucher, Alexander <alexander.deuc...@amd.com>
Cc: Chen, Guchun <guchun.c...@amd.com>
Subject: [PATCH] drm/amdgpu: guard ras debugfs creation/removal based on 
CONFIG_DEBUG_FS

It can avoid potential build warn/error when CONFIG_DEBUG_FS is not set.

Signed-off-by: Guchun Chen <guchun.c...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 35d5bf9e6f6f..e1d78cb448e2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -1244,6 +1244,7 @@ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
 
 void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev)  {
+#if defined(CONFIG_DEBUG_FS)
        struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
        struct ras_manager *obj;
        struct ras_fs_if fs_info;
@@ -1266,6 +1267,7 @@ void amdgpu_ras_debugfs_create_all(struct amdgpu_device 
*adev)
                        amdgpu_ras_debugfs_create(adev, &fs_info);
                }
        }
+#endif
 }
 
 void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev, @@ -1282,6 +1284,7 
@@ void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
 
 static void amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev)  {
+#if defined(CONFIG_DEBUG_FS)
        struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
        struct ras_manager *obj, *tmp;
 
@@ -1290,6 +1293,7 @@ static void amdgpu_ras_debugfs_remove_all(struct 
amdgpu_device *adev)
        }
 
        con->dir = NULL;
+#endif
 }
 /* debugfs end */
 
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to