drm/amdgpu: use ARRAY_SIZE() to add amdgpu debugfs files
to easily add new debugfs file w/o changing the hardcoded list count. Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
3a4024b58b
commit
9987d70d10
|
@ -781,8 +781,10 @@ int amdgpu_debugfs_fence_init(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
#if defined(CONFIG_DEBUG_FS)
|
||||||
if (amdgpu_sriov_vf(adev))
|
if (amdgpu_sriov_vf(adev))
|
||||||
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list_sriov, 1);
|
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list_sriov,
|
||||||
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list, 2);
|
ARRAY_SIZE(amdgpu_debugfs_fence_list_sriov));
|
||||||
|
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list,
|
||||||
|
ARRAY_SIZE(amdgpu_debugfs_fence_list));
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -930,7 +930,8 @@ static const struct drm_info_list amdgpu_debugfs_gem_list[] = {
|
||||||
int amdgpu_debugfs_gem_init(struct amdgpu_device *adev)
|
int amdgpu_debugfs_gem_init(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
#if defined(CONFIG_DEBUG_FS)
|
||||||
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_gem_list, 1);
|
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_gem_list,
|
||||||
|
ARRAY_SIZE(amdgpu_debugfs_gem_list));
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -468,7 +468,8 @@ static const struct drm_info_list amdgpu_debugfs_sa_list[] = {
|
||||||
int amdgpu_debugfs_sa_init(struct amdgpu_device *adev)
|
int amdgpu_debugfs_sa_init(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_DEBUG_FS)
|
#if defined(CONFIG_DEBUG_FS)
|
||||||
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_sa_list, 1);
|
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_sa_list,
|
||||||
|
ARRAY_SIZE(amdgpu_debugfs_sa_list));
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue