[PATCH] drm/amdgpu: guard ras debugfs creation/removal based on CONFIG_DEBUG_FS

Zhou1, Tao Tao.Zhou1 at amd.com
Thu Aug 13 07:55:20 UTC 2020


[AMD Public Use]

Reviewed-by: Tao Zhou <tao.zhou1 at amd.com>

> -----Original Message-----
> From: Chen, Guchun <Guchun.Chen at amd.com>
> Sent: Thursday, August 13, 2020 3:04 PM
> To: amd-gfx at lists.freedesktop.org; Zhang, Hawking
> <Hawking.Zhang at amd.com>; Li, Dennis <Dennis.Li at amd.com>; Zhou1, Tao
> <Tao.Zhou1 at amd.com>; Clements, John <John.Clements at amd.com>; Deucher,
> Alexander <Alexander.Deucher at amd.com>
> Cc: Chen, Guchun <Guchun.Chen at 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.chen at 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


More information about the amd-gfx mailing list